@abaplint/transpiler-cli 2.3.87 → 2.3.89
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 +12 -12
- package/abap_transpile +2 -2
- package/build/bundle.js +37 -37
- package/package.json +38 -38
package/build/bundle.js
CHANGED
|
@@ -38,7 +38,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
38
38
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
39
39
|
|
|
40
40
|
"use strict";
|
|
41
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nconst fs = __webpack_require__(/*! fs */ \"fs\");\r\nconst path = __webpack_require__(/*! path */ \"path\");\r\nconst glob = __webpack_require__(/*! glob */ \"./node_modules/glob/glob.js\");\r\nconst childProcess = __webpack_require__(/*! child_process */ \"child_process\");\r\nconst os = __webpack_require__(/*! os */ \"os\");\r\nconst ProgressBar = __webpack_require__(/*! progress */ \"./node_modules/progress/index.js\");\r\nconst Transpiler = __webpack_require__(/*! @abaplint/transpiler */ \"./node_modules/@abaplint/transpiler/build/src/index.js\");\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst config_1 = __webpack_require__(/*! ./config */ \"./build/config.js\");\r\nconst file_operations_1 = __webpack_require__(/*! ./file_operations */ \"./build/file_operations.js\");\r\nclass Progress {\r\n set(total, _text) {\r\n this.bar = new ProgressBar(\":percent - :elapseds - :text\", { total, renderThrottle: 100 });\r\n }\r\n async tick(text) {\r\n this.bar.tick({ text });\r\n this.bar.render();\r\n }\r\n}\r\nfunction loadLib(config) {\r\n const files = [];\r\n if (config.lib && config.lib !== \"\" && config.libs === undefined) {\r\n config.libs = [{ url: config.lib }];\r\n }\r\n for (const l of config.libs || []) {\r\n let dir = \"\";\r\n let cleanupFolder = false;\r\n if (l.folder !== undefined && l.folder !== \"\" && fs.existsSync(process.cwd() + l.folder)) {\r\n console.log(\"From folder: \" + l.folder);\r\n dir = process.cwd() + l.folder;\r\n }\r\n else {\r\n console.log(\"Clone: \" + l.url);\r\n dir = fs.mkdtempSync(path.join(os.tmpdir(), \"abap_transpile-\"));\r\n childProcess.execSync(\"git clone --quiet --depth 1 \" + l.url + \" .\", { cwd: dir, stdio: \"inherit\" });\r\n cleanupFolder = true;\r\n }\r\n let count = 0;\r\n let pattern = \"/src/**\";\r\n if (l.files !== undefined && l.files !== \"\") {\r\n pattern = l.files;\r\n }\r\n for (let filename of glob.sync(dir + pattern, { nosort: true, nodir: true })) {\r\n if (filename.endsWith(\".clas.testclasses.abap\")) {\r\n continue;\r\n }\r\n const contents = fs.readFileSync(filename, \"utf8\");\r\n filename = path.basename(filename);\r\n files.push({ filename, contents });\r\n count++;\r\n }\r\n console.log(count + \" files added from lib\");\r\n if (cleanupFolder === true) {\r\n file_operations_1.FileOperations.deleteFolderRecursive(dir);\r\n }\r\n }\r\n return files;\r\n}\r\nfunction writeObjects(objects, writeSourceMaps, outputFolder, files) {\r\n for (const o of objects) {\r\n let contents = o.chunk.getCode();\r\n if (writeSourceMaps === true\r\n && o.object.type.toUpperCase() !== \"TABL\"\r\n && o.object.type.toUpperCase() !== \"DTEL\"\r\n && o.object.type.toUpperCase() !== \"ENQU\"\r\n && o.object.type.toUpperCase() !== \"TTYP\") {\r\n const name = o.filename + \".map\";\r\n // SourceMappingUrl needs to be percent-encoded, ref https://github.com/microsoft/TypeScript/issues/40951\r\n contents = contents + `\\n//# sourceMappingURL=` + name.replace(/#/g, \"%23\");\r\n let map = o.chunk.getMap(o.filename);\r\n for (const f of files) { // hack the paths to the original files\r\n if (f.relative === undefined) {\r\n continue;\r\n }\r\n if (map.includes(`\"${f.filename}\"`)) {\r\n let withPath = `\"${f.relative}${path.sep}${f.filename}\"`;\r\n withPath = withPath.replace(/\\\\/g, \"\\\\\\\\\");\r\n map = map.replace(`\"${f.filename}\"`, withPath);\r\n }\r\n }\r\n fs.writeFileSync(outputFolder + path.sep + name, map);\r\n }\r\n if (o.object.type.toUpperCase() === \"PROG\") {\r\n // hmm, will this work for INCLUDEs ?\r\n contents = `await import(\"./_init.mjs\");\\n` + contents;\r\n }\r\n fs.writeFileSync(outputFolder + path.sep + o.filename, contents);\r\n }\r\n}\r\nasync function run() {\r\n console.log(\"Transpiler CLI\");\r\n const config = config_1.TranspilerConfig.find(process.argv[2]);\r\n const libFiles = loadLib(config);\r\n const files = file_operations_1.FileOperations.loadFiles(config);\r\n console.log(\"\\nBuilding\");\r\n const t = new Transpiler.Transpiler(config.options);\r\n const reg = new abaplint.Registry();\r\n for (const f of files) {\r\n reg.addFile(new abaplint.MemoryFile(f.filename, f.contents));\r\n }\r\n for (const l of libFiles) {\r\n reg.addDependency(new abaplint.MemoryFile(l.filename, l.contents));\r\n }\r\n reg.parse();\r\n const output = await t.run(reg, new Progress());\r\n console.log(\"\\nOutput\");\r\n const outputFolder = config.output_folder;\r\n if (!fs.existsSync(outputFolder)) {\r\n fs.mkdirSync(outputFolder);\r\n }\r\n writeObjects(output.objects, config.write_source_map, outputFolder, files);\r\n console.log(output.objects.length + \" objects written to disk\");\r\n if (config.write_unit_tests === true) {\r\n // breaking change? rename this output file,\r\n fs.writeFileSync(outputFolder + path.sep + \"index.mjs\", output.unitTestScript);\r\n fs.writeFileSync(outputFolder + path.sep + \"_unit_open.mjs\", output.unitTestScriptOpen);\r\n }\r\n // breaking change? rename this output file,\r\n fs.writeFileSync(outputFolder + path.sep + \"init.mjs\", output.initializationScript);\r\n // new static referenced imports,\r\n fs.writeFileSync(outputFolder + path.sep + \"_init.mjs\", output.initializationScript2);\r\n fs.writeFileSync(outputFolder + path.sep + \"_top.mjs\", `import runtime from \"@abaplint/runtime\";\
|
|
41
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nconst fs = __webpack_require__(/*! fs */ \"fs\");\r\nconst path = __webpack_require__(/*! path */ \"path\");\r\nconst glob = __webpack_require__(/*! glob */ \"./node_modules/glob/glob.js\");\r\nconst childProcess = __webpack_require__(/*! child_process */ \"child_process\");\r\nconst os = __webpack_require__(/*! os */ \"os\");\r\nconst ProgressBar = __webpack_require__(/*! progress */ \"./node_modules/progress/index.js\");\r\nconst Transpiler = __webpack_require__(/*! @abaplint/transpiler */ \"./node_modules/@abaplint/transpiler/build/src/index.js\");\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst config_1 = __webpack_require__(/*! ./config */ \"./build/config.js\");\r\nconst file_operations_1 = __webpack_require__(/*! ./file_operations */ \"./build/file_operations.js\");\r\nclass Progress {\r\n set(total, _text) {\r\n this.bar = new ProgressBar(\":percent - :elapseds - :text\", { total, renderThrottle: 100 });\r\n }\r\n async tick(text) {\r\n this.bar.tick({ text });\r\n this.bar.render();\r\n }\r\n}\r\nfunction loadLib(config) {\r\n const files = [];\r\n if (config.lib && config.lib !== \"\" && config.libs === undefined) {\r\n config.libs = [{ url: config.lib }];\r\n }\r\n for (const l of config.libs || []) {\r\n let dir = \"\";\r\n let cleanupFolder = false;\r\n if (l.folder !== undefined && l.folder !== \"\" && fs.existsSync(process.cwd() + l.folder)) {\r\n console.log(\"From folder: \" + l.folder);\r\n dir = process.cwd() + l.folder;\r\n }\r\n else {\r\n console.log(\"Clone: \" + l.url);\r\n dir = fs.mkdtempSync(path.join(os.tmpdir(), \"abap_transpile-\"));\r\n childProcess.execSync(\"git clone --quiet --depth 1 \" + l.url + \" .\", { cwd: dir, stdio: \"inherit\" });\r\n cleanupFolder = true;\r\n }\r\n let count = 0;\r\n let pattern = \"/src/**\";\r\n if (l.files !== undefined && l.files !== \"\") {\r\n pattern = l.files;\r\n }\r\n for (let filename of glob.sync(dir + pattern, { nosort: true, nodir: true })) {\r\n if (filename.endsWith(\".clas.testclasses.abap\")) {\r\n continue;\r\n }\r\n const contents = fs.readFileSync(filename, \"utf8\");\r\n filename = path.basename(filename);\r\n files.push({ filename, contents });\r\n count++;\r\n }\r\n console.log(count + \" files added from lib\");\r\n if (cleanupFolder === true) {\r\n file_operations_1.FileOperations.deleteFolderRecursive(dir);\r\n }\r\n }\r\n return files;\r\n}\r\nfunction writeObjects(objects, writeSourceMaps, outputFolder, files) {\r\n for (const o of objects) {\r\n let contents = o.chunk.getCode();\r\n if (writeSourceMaps === true\r\n && o.object.type.toUpperCase() !== \"TABL\"\r\n && o.object.type.toUpperCase() !== \"DTEL\"\r\n && o.object.type.toUpperCase() !== \"ENQU\"\r\n && o.object.type.toUpperCase() !== \"TTYP\") {\r\n const name = o.filename + \".map\";\r\n // SourceMappingUrl needs to be percent-encoded, ref https://github.com/microsoft/TypeScript/issues/40951\r\n contents = contents + `\\n//# sourceMappingURL=` + name.replace(/#/g, \"%23\");\r\n let map = o.chunk.getMap(o.filename);\r\n for (const f of files) { // hack the paths to the original files\r\n if (f.relative === undefined) {\r\n continue;\r\n }\r\n if (map.includes(`\"${f.filename}\"`)) {\r\n let withPath = `\"${f.relative}${path.sep}${f.filename}\"`;\r\n withPath = withPath.replace(/\\\\/g, \"\\\\\\\\\");\r\n map = map.replace(`\"${f.filename}\"`, withPath);\r\n }\r\n }\r\n fs.writeFileSync(outputFolder + path.sep + name, map);\r\n }\r\n if (o.object.type.toUpperCase() === \"PROG\") {\r\n // hmm, will this work for INCLUDEs ?\r\n contents = `await import(\"./_init.mjs\");\\n` + contents;\r\n }\r\n fs.writeFileSync(outputFolder + path.sep + o.filename, contents);\r\n }\r\n}\r\nasync function run() {\r\n console.log(\"Transpiler CLI\");\r\n const config = config_1.TranspilerConfig.find(process.argv[2]);\r\n const libFiles = loadLib(config);\r\n const files = file_operations_1.FileOperations.loadFiles(config);\r\n console.log(\"\\nBuilding\");\r\n const t = new Transpiler.Transpiler(config.options);\r\n const reg = new abaplint.Registry();\r\n for (const f of files) {\r\n reg.addFile(new abaplint.MemoryFile(f.filename, f.contents));\r\n }\r\n for (const l of libFiles) {\r\n reg.addDependency(new abaplint.MemoryFile(l.filename, l.contents));\r\n }\r\n reg.parse();\r\n const output = await t.run(reg, new Progress());\r\n console.log(\"\\nOutput\");\r\n const outputFolder = config.output_folder;\r\n if (!fs.existsSync(outputFolder)) {\r\n fs.mkdirSync(outputFolder);\r\n }\r\n writeObjects(output.objects, config.write_source_map, outputFolder, files);\r\n console.log(output.objects.length + \" objects written to disk\");\r\n if (config.write_unit_tests === true) {\r\n // breaking change? rename this output file,\r\n fs.writeFileSync(outputFolder + path.sep + \"index.mjs\", output.unitTestScript);\r\n fs.writeFileSync(outputFolder + path.sep + \"_unit_open.mjs\", output.unitTestScriptOpen);\r\n }\r\n // breaking change? rename this output file,\r\n fs.writeFileSync(outputFolder + path.sep + \"init.mjs\", output.initializationScript);\r\n // new static referenced imports,\r\n fs.writeFileSync(outputFolder + path.sep + \"_init.mjs\", output.initializationScript2);\r\n fs.writeFileSync(outputFolder + path.sep + \"_top.mjs\", `import runtime from \"@abaplint/runtime\";\nglobalThis.abap = new runtime.ABAP();`);\r\n}\r\nrun().then(() => {\r\n process.exit();\r\n}).catch((err) => {\r\n console.log(err);\r\n process.exit(1);\r\n});\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./build/index.js?");
|
|
42
42
|
|
|
43
43
|
/***/ }),
|
|
44
44
|
|
|
@@ -6517,7 +6517,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6517
6517
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6518
6518
|
|
|
6519
6519
|
"use strict";
|
|
6520
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BuiltIn = void 0;\r\n/* eslint-disable max-len */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass BuiltInMethod extends _identifier_1.Identifier {\r\n constructor(token, filename, method, row) {\r\n super(token, filename);\r\n this.method = method;\r\n this.row = row;\r\n }\r\n getRequiredParameters() {\r\n return [];\r\n }\r\n getOptional() {\r\n throw new Error(\"BuiltInMethod->Method not implemented.\");\r\n }\r\n getAll() {\r\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\r\n }\r\n getImporting() {\r\n const ret = [];\r\n for (const i in this.method.mandatory) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\r\n }\r\n for (const i in this.method.optional) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\r\n }\r\n return ret;\r\n }\r\n getDefaultImporting() {\r\n if (this.method.mandatory === undefined) {\r\n return undefined;\r\n }\r\n const keys = Object.keys(this.method.mandatory);\r\n if (keys.length === 1) {\r\n return keys[0].toUpperCase();\r\n }\r\n return undefined;\r\n }\r\n getExporting() {\r\n return [];\r\n }\r\n getRaising() {\r\n return [];\r\n }\r\n getChanging() {\r\n return [];\r\n }\r\n getReturning() {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\r\n }\r\n getExceptions() {\r\n return [];\r\n }\r\n getVisibility() {\r\n return visibility_1.Visibility.Public;\r\n }\r\n isRedefinition() {\r\n return false;\r\n }\r\n isAbstract() {\r\n return false;\r\n }\r\n isStatic() {\r\n return false;\r\n }\r\n isEventHandler() {\r\n return false;\r\n }\r\n getParameters() {\r\n return this;\r\n }\r\n getParameterDefault(_parameter) {\r\n return undefined;\r\n }\r\n}\r\nclass BuiltIn {\r\n constructor() {\r\n this.row = 1;\r\n }\r\n buildDefinition(method, row) {\r\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\r\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\r\n }\r\n searchBuiltin(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n // todo, optimize, use hash map\r\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return this.buildDefinition(BuiltIn.methods[index], index);\r\n }\r\n isPredicate(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n // todo, optimize, use hash map\r\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return BuiltIn.methods[index].predicate;\r\n }\r\n getTypes() {\r\n const ret = this.buildSY();\r\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" })));\r\n return ret;\r\n }\r\n get(extras) {\r\n const ret = this.buildSY();\r\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\r\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\r\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\r\n ret.push(this.buildConstant(\"%_CR_LF\"));\r\n ret.push(this.buildConstant(\"%_ENDIAN\"));\r\n ret.push(this.buildConstant(\"%_FORMFEED\"));\r\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\r\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\r\n ret.push(this.buildConstant(\"%_MINCHAR\"));\r\n ret.push(this.buildConstant(\"%_NEWLINE\"));\r\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\r\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\r\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'-'\"));\r\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\r\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\r\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\r\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\r\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\r\n ret.push(this.buildConstant(\"col_group\", new basic_1.IntegerType(), \"7\"));\r\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\r\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\r\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\r\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1), \"' '\"));\r\n for (const e of extras) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], \"'?'\"));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////\r\n buildSY() {\r\n const components = [];\r\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26, { qualifiedName: \"sy-abcde\" }) });\r\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-batch\" }) });\r\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-binpt\" }) });\r\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-calld\" }) });\r\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8, { qualifiedName: \"sy-callr\" }) });\r\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-cprog\" }) });\r\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-datar\" }) });\r\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\r\n components.push({ name: \"datum\", type: new basic_1.DateType() });\r\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-dbnam\" }) });\r\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-dbsys\" }) });\r\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dyngr\" }) });\r\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dynnr\" }) });\r\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"host\", type: new basic_1.CharacterType(32, { qualifiedName: \"sy-host\" }) });\r\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"input\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-input\" }) });\r\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-langu\", conversionExit: \"ISOLA\" }) });\r\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-ldbpg\" }) });\r\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-lisel\" }) });\r\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-mandt\" }) });\r\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-msgid\" }) });\r\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60, { qualifiedName: \"sy-msgli\" }) });\r\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3, \"sy-msgno\") });\r\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-msgty\" }) });\r\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv1\" }) });\r\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv2\" }) });\r\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv3\" }) });\r\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv4\" }) });\r\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-opsys\" }) });\r\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-pdest\" }) });\r\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-pfkey\" }) });\r\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-repid\" }) });\r\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-saprl\" }) });\r\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14, { qualifiedName: \"sy-slset\" }) });\r\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-spono\" }) });\r\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-sysid\" }) });\r\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tcode\" }) });\r\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\r\n components.push({ name: \"title\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-title\" }) });\r\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar0\" }) });\r\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar1\" }) });\r\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar2\" }) });\r\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar3\" }) });\r\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar4\" }) });\r\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar5\" }) });\r\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar6\" }) });\r\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar7\" }) });\r\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar8\" }) });\r\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar9\" }) });\r\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-ucomm\" }) });\r\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-uline\" }) });\r\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12, { qualifiedName: \"sy-uname\" }) });\r\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\r\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-vline\" }) });\r\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-wtitl\" }) });\r\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6, { qualifiedName: \"sy-zonlo\" }) });\r\n const type = new basic_1.StructureType(components);\r\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\r\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\r\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\r\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\r\n return [sy, syst];\r\n }\r\n buildConstant(name, type, value) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n if (type === undefined) {\r\n type = new basic_1.VoidType(name);\r\n }\r\n if (value === undefined) {\r\n value = \"'?'\";\r\n }\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], value);\r\n }\r\n buildVariable(name) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* IdentifierMeta.BuiltIn */]);\r\n }\r\n}\r\nexports.BuiltIn = BuiltIn;\r\nBuiltIn.filename = \"_builtin.prog.abap\";\r\n// todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\r\n// todo: \"pcre\", only possible from 755\r\nBuiltIn.methods = [\r\n {\r\n name: \"ABS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"ACOS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ASIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ATAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"BIT-SET\",\r\n mandatory: {\r\n \"val\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLC\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLX\",\r\n mandatory: {\r\n \"bool\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"bit\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CEIL\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CHAR_OFF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"add\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CHARLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONCAT_LINES_OF\",\r\n mandatory: {\r\n \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONDENSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"del\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n predicate: true,\r\n return: new basic_1.CharacterType(1), version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COSH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COUNT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"DBMAXLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"DISTANCE\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ESCAPE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"format\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"EXP\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"FIND\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_END\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FLOOR\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FRAC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FROM_MIXED\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"INSERT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"sub\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"IPOW\",\r\n mandatory: {\r\n \"base\": new basic_1.FloatType(),\r\n \"exp\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_EXISTS\",\r\n mandatory: {\r\n \"val\": new basic_1.AnyType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_INDEX\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINES\",\r\n mandatory: {\r\n \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"LOG\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"LOG10\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"MATCH\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n }, optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"MATCHES\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NUMOFCHAR\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"REPEAT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REPLACE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"with\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"RESCALE\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REVERSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ROUND\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SEGMENT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"index\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n \"space\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_LEFT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_RIGHT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SIGN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SINH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SQRT\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"STRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SUBSTRING\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_AFTER\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_BEFORE\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_FROM\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_TO\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TANH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TO_LOWER\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_MIXED\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_UPPER\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRANSLATE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRUNC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"UTCLONG_ADD\",\r\n mandatory: {\r\n \"val\": new basic_1.UTCLongType(),\r\n },\r\n optional: {\r\n \"days\": new basic_1.IntegerType(),\r\n \"hour\": new basic_1.IntegerType(),\r\n \"minutes\": new basic_1.IntegerType(),\r\n \"seconds\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_CURRENT\",\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_DIFF\",\r\n mandatory: {\r\n \"high\": new basic_1.UTCLongType(),\r\n \"low\": new basic_1.UTCLongType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"XSDBOOL\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v740sp08,\r\n },\r\n {\r\n name: \"XSTRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.XStringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n];\r\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
|
|
6520
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BuiltIn = exports.BuiltInMethod = void 0;\r\n/* eslint-disable max-len */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass BuiltInMethod extends _identifier_1.Identifier {\r\n constructor(token, filename, method, row) {\r\n super(token, filename);\r\n this.method = method;\r\n this.row = row;\r\n }\r\n getRequiredParameters() {\r\n return [];\r\n }\r\n getOptional() {\r\n throw new Error(\"BuiltInMethod->Method not implemented.\");\r\n }\r\n getAll() {\r\n throw new Error(\"BuiltInMethod->getAll, Method not implemented.\");\r\n }\r\n getImporting() {\r\n const ret = [];\r\n for (const i in this.method.mandatory) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));\r\n }\r\n for (const i in this.method.optional) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.optional[i]));\r\n }\r\n return ret;\r\n }\r\n getDefaultImporting() {\r\n if (this.method.mandatory === undefined) {\r\n return undefined;\r\n }\r\n const keys = Object.keys(this.method.mandatory);\r\n if (keys.length === 1) {\r\n return keys[0].toUpperCase();\r\n }\r\n return undefined;\r\n }\r\n getExporting() {\r\n return [];\r\n }\r\n getRaising() {\r\n return [];\r\n }\r\n getChanging() {\r\n return [];\r\n }\r\n getReturning() {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), \"ret\");\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.return);\r\n }\r\n getExceptions() {\r\n return [];\r\n }\r\n getVisibility() {\r\n return visibility_1.Visibility.Public;\r\n }\r\n isRedefinition() {\r\n return false;\r\n }\r\n isAbstract() {\r\n return false;\r\n }\r\n isStatic() {\r\n return false;\r\n }\r\n isEventHandler() {\r\n return false;\r\n }\r\n getParameters() {\r\n return this;\r\n }\r\n getParameterDefault(_parameter) {\r\n return undefined;\r\n }\r\n}\r\nexports.BuiltInMethod = BuiltInMethod;\r\nclass BuiltIn {\r\n constructor() {\r\n this.row = 1;\r\n }\r\n buildDefinition(method, row) {\r\n const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);\r\n return new BuiltInMethod(token, BuiltIn.filename, method, row);\r\n }\r\n searchBuiltin(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n // todo, optimize, use hash map\r\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return this.buildDefinition(BuiltIn.methods[index], index);\r\n }\r\n isPredicate(name) {\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n // todo, optimize, use hash map\r\n const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());\r\n if (index < 0) {\r\n return undefined;\r\n }\r\n return BuiltIn.methods[index].predicate;\r\n }\r\n getTypes() {\r\n const ret = this.buildSY();\r\n const id = new tokens_1.Identifier(new position_1.Position(1, 1), \"abap_bool\");\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" })));\r\n return ret;\r\n }\r\n get(extras) {\r\n const ret = this.buildSY();\r\n ret.push(this.buildVariable(\"screen\")); // todo, add structure, or alternatively make native Statements\r\n ret.push(this.buildConstant(\"%_BACKSPACE\"));\r\n ret.push(this.buildConstant(\"%_CHARSIZE\"));\r\n ret.push(this.buildConstant(\"%_CR_LF\"));\r\n ret.push(this.buildConstant(\"%_ENDIAN\"));\r\n ret.push(this.buildConstant(\"%_FORMFEED\"));\r\n ret.push(this.buildConstant(\"%_HORIZONTAL_TAB\"));\r\n ret.push(this.buildConstant(\"%_MAXCHAR\"));\r\n ret.push(this.buildConstant(\"%_MINCHAR\"));\r\n ret.push(this.buildConstant(\"%_NEWLINE\"));\r\n ret.push(this.buildConstant(\"%_VERTICAL_TAB\"));\r\n ret.push(this.buildConstant(\"abap_false\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_true\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\r\n ret.push(this.buildConstant(\"abap_undefined\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'-'\"));\r\n ret.push(this.buildConstant(\"abap_off\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"' '\"));\r\n ret.push(this.buildConstant(\"abap_on\", new basic_1.CharacterType(1, { qualifiedName: \"ABAP_BOOL\", ddicName: \"ABAP_BOOL\" }), \"'X'\"));\r\n ret.push(this.buildConstant(\"col_background\", new basic_1.IntegerType(), \"0\"));\r\n ret.push(this.buildConstant(\"col_heading\", new basic_1.IntegerType(), \"1\"));\r\n ret.push(this.buildConstant(\"col_key\", new basic_1.IntegerType(), \"4\"));\r\n ret.push(this.buildConstant(\"col_negative\", new basic_1.IntegerType(), \"6\"));\r\n ret.push(this.buildConstant(\"col_group\", new basic_1.IntegerType(), \"7\"));\r\n ret.push(this.buildConstant(\"col_normal\", new basic_1.IntegerType(), \"2\"));\r\n ret.push(this.buildConstant(\"col_positive\", new basic_1.IntegerType(), \"5\"));\r\n ret.push(this.buildConstant(\"col_total\", new basic_1.IntegerType(), \"3\"));\r\n ret.push(this.buildConstant(\"space\", new basic_1.CharacterType(1), \"' '\"));\r\n for (const e of extras) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);\r\n ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], \"'?'\"));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////\r\n buildSY() {\r\n const components = [];\r\n components.push({ name: \"abcde\", type: new basic_1.CharacterType(26, { qualifiedName: \"sy-abcde\" }) });\r\n components.push({ name: \"batch\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-batch\" }) });\r\n components.push({ name: \"binpt\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-binpt\" }) });\r\n components.push({ name: \"calld\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-calld\" }) });\r\n components.push({ name: \"callr\", type: new basic_1.CharacterType(8, { qualifiedName: \"sy-callr\" }) });\r\n components.push({ name: \"colno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cpage\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"cprog\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-cprog\" }) });\r\n components.push({ name: \"cucol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"curow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"datar\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-datar\" }) });\r\n components.push({ name: \"datlo\", type: new basic_1.DateType() });\r\n components.push({ name: \"datum\", type: new basic_1.DateType() });\r\n components.push({ name: \"dayst\", type: new basic_1.CharacterType(1) });\r\n components.push({ name: \"dbcnt\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"dbnam\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-dbnam\" }) });\r\n components.push({ name: \"dbsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-dbsys\" }) });\r\n components.push({ name: \"dyngr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dyngr\" }) });\r\n components.push({ name: \"dynnr\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-dynnr\" }) });\r\n components.push({ name: \"fdayw\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fdpos\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"fleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"folen\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"host\", type: new basic_1.CharacterType(32, { qualifiedName: \"sy-host\" }) });\r\n components.push({ name: \"index\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"input\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-input\" }) });\r\n components.push({ name: \"langu\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-langu\", conversionExit: \"ISOLA\" }) });\r\n components.push({ name: \"ldbpg\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-ldbpg\" }) });\r\n components.push({ name: \"lilli\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linct\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"linsz\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lisel\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-lisel\" }) });\r\n components.push({ name: \"listi\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"loopc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"lsind\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"macol\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"mandt\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-mandt\" }) });\r\n components.push({ name: \"marow\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"modno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"msgid\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-msgid\" }) });\r\n components.push({ name: \"msgli\", type: new basic_1.CharacterType(60, { qualifiedName: \"sy-msgli\" }) });\r\n components.push({ name: \"msgno\", type: new basic_1.NumericType(3, \"sy-msgno\") });\r\n components.push({ name: \"msgty\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-msgty\" }) });\r\n components.push({ name: \"msgv1\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv1\" }) });\r\n components.push({ name: \"msgv2\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv2\" }) });\r\n components.push({ name: \"msgv3\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv3\" }) });\r\n components.push({ name: \"msgv4\", type: new basic_1.CharacterType(50, { qualifiedName: \"sy-msgv4\" }) });\r\n components.push({ name: \"opsys\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-opsys\" }) });\r\n components.push({ name: \"pagno\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"pdest\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-pdest\" }) });\r\n components.push({ name: \"pfkey\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-pfkey\" }) });\r\n components.push({ name: \"repid\", type: new basic_1.CharacterType(40, { qualifiedName: \"sy-repid\" }) });\r\n components.push({ name: \"saprl\", type: new basic_1.CharacterType(4, { qualifiedName: \"sy-saprl\" }) });\r\n components.push({ name: \"scols\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"slset\", type: new basic_1.CharacterType(14, { qualifiedName: \"sy-slset\" }) });\r\n components.push({ name: \"spono\", type: new basic_1.CharacterType(10, { qualifiedName: \"sy-spono\" }) });\r\n components.push({ name: \"srows\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staco\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"staro\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"stepl\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"subrc\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"sysid\", type: new basic_1.CharacterType(3, { qualifiedName: \"sy-sysid\" }) });\r\n components.push({ name: \"tabix\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tcode\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tcode\" }) });\r\n components.push({ name: \"tfill\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"timlo\", type: new basic_1.TimeType() });\r\n components.push({ name: \"title\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-title\" }) });\r\n components.push({ name: \"tleng\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"tvar0\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar0\" }) });\r\n components.push({ name: \"tvar1\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar1\" }) });\r\n components.push({ name: \"tvar2\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar2\" }) });\r\n components.push({ name: \"tvar3\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar3\" }) });\r\n components.push({ name: \"tvar4\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar4\" }) });\r\n components.push({ name: \"tvar5\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar5\" }) });\r\n components.push({ name: \"tvar6\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar6\" }) });\r\n components.push({ name: \"tvar7\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar7\" }) });\r\n components.push({ name: \"tvar8\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar8\" }) });\r\n components.push({ name: \"tvar9\", type: new basic_1.CharacterType(20, { qualifiedName: \"sy-tvar9\" }) });\r\n components.push({ name: \"tzone\", type: new basic_1.IntegerType() });\r\n components.push({ name: \"ucomm\", type: new basic_1.CharacterType(70, { qualifiedName: \"sy-ucomm\" }) });\r\n components.push({ name: \"uline\", type: new basic_1.CharacterType(255, { qualifiedName: \"sy-uline\" }) });\r\n components.push({ name: \"uname\", type: new basic_1.CharacterType(12, { qualifiedName: \"sy-uname\" }) });\r\n components.push({ name: \"uzeit\", type: new basic_1.TimeType() });\r\n components.push({ name: \"vline\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-vline\" }) });\r\n components.push({ name: \"wtitl\", type: new basic_1.CharacterType(1, { qualifiedName: \"sy-wtitl\" }) });\r\n components.push({ name: \"zonlo\", type: new basic_1.CharacterType(6, { qualifiedName: \"sy-zonlo\" }) });\r\n const type = new basic_1.StructureType(components);\r\n const id1 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"sy\");\r\n const sy = new _typed_identifier_1.TypedIdentifier(id1, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\r\n const id2 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), \"syst\");\r\n const syst = new _typed_identifier_1.TypedIdentifier(id2, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */]);\r\n return [sy, syst];\r\n }\r\n buildConstant(name, type, value) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n if (type === undefined) {\r\n type = new basic_1.VoidType(name);\r\n }\r\n if (value === undefined) {\r\n value = \"'?'\";\r\n }\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, [\"read_only\" /* IdentifierMeta.ReadOnly */, \"built-in\" /* IdentifierMeta.BuiltIn */], value);\r\n }\r\n buildVariable(name) {\r\n const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);\r\n return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), [\"built-in\" /* IdentifierMeta.BuiltIn */]);\r\n }\r\n}\r\nexports.BuiltIn = BuiltIn;\r\nBuiltIn.filename = \"_builtin.prog.abap\";\r\n// todo: \"pcre\" vs \"regex\", only one of these parameters are allowed\r\n// todo: \"pcre\", only possible from 755\r\nBuiltIn.methods = [\r\n {\r\n name: \"ABS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"ACOS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ASIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"ATAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"BIT-SET\",\r\n mandatory: {\r\n \"val\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLC\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"BOOLX\",\r\n mandatory: {\r\n \"bool\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"bit\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.XStringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CEIL\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CHAR_OFF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"add\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CHARLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"CMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONCAT_LINES_OF\",\r\n mandatory: {\r\n \"table\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONDENSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"del\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n predicate: true,\r\n return: new basic_1.CharacterType(1), version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"CONTAINS_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"start\": new basic_1.StringType(),\r\n \"end\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COS\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COSH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"COUNT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"COUNT_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"DBMAXLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"DISTANCE\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ESCAPE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"format\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"EXP\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"FIND\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_NOT_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_ANY_OF\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FIND_END\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"FLOOR\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FRAC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"FROM_MIXED\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"INSERT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"sub\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"IPOW\",\r\n mandatory: {\r\n \"base\": new basic_1.FloatType(),\r\n \"exp\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_EXISTS\",\r\n mandatory: {\r\n \"val\": new basic_1.AnyType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINE_INDEX\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v740sp02,\r\n },\r\n {\r\n name: \"LINES\",\r\n mandatory: {\r\n \"val\": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"LOG\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"LOG10\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"MATCH\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n }, optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"MATCHES\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n predicate: true,\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMAX\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NMIN\",\r\n mandatory: {\r\n \"val1\": new basic_1.StringType(),\r\n \"val2\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"val3\": new basic_1.StringType(),\r\n \"val4\": new basic_1.StringType(),\r\n \"val5\": new basic_1.StringType(),\r\n \"val6\": new basic_1.StringType(),\r\n \"val7\": new basic_1.StringType(),\r\n \"val8\": new basic_1.StringType(),\r\n \"val9\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"NUMOFCHAR\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"REPEAT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REPLACE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"with\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"RESCALE\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"REVERSE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"ROUND\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n optional: {\r\n \"dec\": new basic_1.IntegerType(),\r\n \"prec\": new basic_1.IntegerType(),\r\n \"mode\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SEGMENT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"index\": new basic_1.IntegerType(),\r\n },\r\n optional: {\r\n \"sep\": new basic_1.StringType(),\r\n \"space\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_LEFT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SHIFT_RIGHT\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"places\": new basic_1.IntegerType(),\r\n \"circular\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SIGN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SIN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SINH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"SQRT\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"STRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"SUBSTRING\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"off\": new basic_1.IntegerType(),\r\n \"len\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_AFTER\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_BEFORE\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_FROM\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"SUBSTRING_TO\",\r\n mandatory: {\r\n \"val\": new basic_1.CLikeType(),\r\n },\r\n optional: {\r\n \"sub\": new basic_1.StringType(),\r\n \"regex\": new basic_1.StringType(),\r\n \"pcre\": new basic_1.StringType(),\r\n \"case\": new basic_1.CharacterType(1),\r\n \"len\": new basic_1.IntegerType(),\r\n \"occ\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TAN\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TANH\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n },\r\n {\r\n name: \"TO_LOWER\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_MIXED\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n optional: {\r\n \"case\": new basic_1.CharacterType(1),\r\n \"sep\": new basic_1.IntegerType(),\r\n \"min\": new basic_1.IntegerType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TO_UPPER\",\r\n mandatory: { \"val\": new basic_1.StringType() },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRANSLATE\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n \"from\": new basic_1.StringType(),\r\n \"to\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.StringType(),\r\n version: version_1.Version.v702,\r\n },\r\n {\r\n name: \"TRUNC\",\r\n mandatory: {\r\n \"val\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n {\r\n name: \"UTCLONG_ADD\",\r\n mandatory: {\r\n \"val\": new basic_1.UTCLongType(),\r\n },\r\n optional: {\r\n \"days\": new basic_1.IntegerType(),\r\n \"hour\": new basic_1.IntegerType(),\r\n \"minutes\": new basic_1.IntegerType(),\r\n \"seconds\": new basic_1.FloatType(),\r\n },\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_CURRENT\",\r\n return: new basic_1.UTCLongType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"UTCLONG_DIFF\",\r\n mandatory: {\r\n \"high\": new basic_1.UTCLongType(),\r\n \"low\": new basic_1.UTCLongType(),\r\n },\r\n return: new basic_1.FloatType(),\r\n version: version_1.Version.v754,\r\n },\r\n {\r\n name: \"XSDBOOL\",\r\n mandatory: {\r\n \"val\": new basic_1.StringType(),\r\n },\r\n return: new basic_1.CharacterType(1),\r\n version: version_1.Version.v740sp08,\r\n },\r\n {\r\n name: \"XSTRLEN\",\r\n mandatory: {\r\n \"val\": new basic_1.XStringType(),\r\n },\r\n return: new basic_1.IntegerType(),\r\n },\r\n];\r\n//# sourceMappingURL=_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js?");
|
|
6521
6521
|
|
|
6522
6522
|
/***/ }),
|
|
6523
6523
|
|
|
@@ -7254,7 +7254,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7254
7254
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7255
7255
|
|
|
7256
7256
|
"use strict";
|
|
7257
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaghettiScope = exports.SpaghettiScopeNode = void 0;\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ScopeData {\r\n constructor() {\r\n this.data = {\r\n vars: {},\r\n cdefs: {},\r\n idefs: [],\r\n forms: [],\r\n types: {},\r\n extraLikeTypes: {},\r\n deferred: [],\r\n references: [],\r\n };\r\n }\r\n getData() {\r\n return this.data;\r\n }\r\n}\r\nclass SpaghettiScopeNode extends ScopeData {\r\n constructor(identifier, parent) {\r\n super();\r\n this.identifier = identifier;\r\n this.parent = parent;\r\n this.children = [];\r\n }\r\n getParent() {\r\n return this.parent;\r\n }\r\n addChild(node) {\r\n this.children.push(node);\r\n }\r\n getChildren() {\r\n return this.children;\r\n }\r\n getFirstChild() {\r\n return this.children[0];\r\n }\r\n getIdentifier() {\r\n return this.identifier;\r\n }\r\n calcCoverage() {\r\n if (this.identifier.end === undefined) {\r\n throw new Error(\"internal error, caclCoverage\");\r\n }\r\n return { start: this.identifier.start, end: this.identifier.end };\r\n }\r\n setEnd(end) {\r\n this.identifier.end = end;\r\n }\r\n findDeferred(name) {\r\n let search = this;\r\n while (search !== undefined) {\r\n for (const d of search.getData().deferred) {\r\n if (d.getStr().toUpperCase() === name.toUpperCase()) {\r\n return new _identifier_1.Identifier(d, search.identifier.filename);\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findClassDefinition(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const c = search.getData().cdefs[upper];\r\n if (c !== undefined) {\r\n return c;\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findFormDefinition(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n for (const form of search.getData().forms) {\r\n if (form.getName().toUpperCase() === upper) {\r\n return form;\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n // todo, can be deleted, not called from anywhere?\r\n listFormDefinitions() {\r\n let search = this;\r\n const ret = [];\r\n while (search !== undefined) {\r\n for (const form of search.getData().forms) {\r\n ret.push(form);\r\n }\r\n search = search.getParent();\r\n }\r\n return ret;\r\n }\r\n // todo, optimize\r\n findInterfaceDefinition(name) {\r\n let search = this;\r\n while (search !== undefined) {\r\n for (const idef of search.getData().idefs) {\r\n if (idef.getName().toUpperCase() === name.toUpperCase()) {\r\n return idef;\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findType(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const data = search.getData();\r\n if (data.types[upper]) {\r\n return data.types[upper];\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findExtraLikeType(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const data = search.getData();\r\n if (data.extraLikeTypes[upper]) {\r\n return data.extraLikeTypes[upper];\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findVariable(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const data = search.getData();\r\n if (data.vars[upper]) {\r\n return data.vars[upper];\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findWriteReference(pos) {\r\n for (const r of this.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n && r.position.getStart().equals(pos)) {\r\n if (r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n return r.resolved;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findTableReference(pos) {\r\n for (const r of this.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TableReference\r\n && r.position.getStart().equals(pos)\r\n && r.resolved) {\r\n return r.resolved.getName();\r\n }\r\n }\r\n return undefined;\r\n }\r\n // TODO, this method can be deleted? its only used in tests?\r\n findScopeForVariable(name) {\r\n let search = this;\r\n while (search !== undefined) {\r\n for (const local in search.getData().vars) {\r\n if (local === name.toUpperCase()) {\r\n return search.getIdentifier();\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SpaghettiScopeNode = SpaghettiScopeNode;\r\nclass SpaghettiScope {\r\n constructor(top) {\r\n this.node = top;\r\n }\r\n // list variable definitions across all nodes\r\n listDefinitions(filename) {\r\n const ret = [];\r\n for (const n of this.allNodes()) {\r\n if (n.getIdentifier().filename === filename) {\r\n const vars = n.getData().vars;\r\n for (const v in vars) {\r\n if (vars[v].getFilename() === filename) {\r\n ret.push({ name: v, identifier: vars[v] });\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n listReadPositions(filename) {\r\n const ret = [];\r\n for (const n of this.allNodes()) {\r\n if (n.getIdentifier().filename === filename) {\r\n for (const v of n.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.DataReadReference && v.position.getFilename() === filename) {\r\n ret.push(v.position);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n listWritePositions(filename) {\r\n const ret = [];\r\n for (const n of this.allNodes()) {\r\n if (n.getIdentifier().filename === filename) {\r\n for (const v of n.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.DataWriteReference && v.position.getFilename() === filename) {\r\n ret.push(v.position);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n lookupPosition(p, filename) {\r\n if (p === undefined || filename === undefined) {\r\n return undefined;\r\n }\r\n return this.lookupPositionTraverse(p, filename, this.node);\r\n }\r\n getFirstChild() {\r\n return this.node.getFirstChild();\r\n }\r\n getTop() {\r\n return this.node;\r\n }\r\n /////////////////////////////\r\n allNodes() {\r\n const ret = [];\r\n const stack = [this.node];\r\n while (stack.length > 0) {\r\n const current = stack.pop();\r\n ret.push(current);\r\n stack.push(...current.getChildren());\r\n }\r\n return ret;\r\n }\r\n lookupPositionTraverse(p, filename, node) {\r\n const coverage = node.calcCoverage();\r\n if (node.getIdentifier().filename === filename && p.isBetween(coverage.start, coverage.end) === false) {\r\n return undefined;\r\n }\r\n // possible optimization: binary search the nodes\r\n for (const c of node.getChildren()) {\r\n const result = this.lookupPositionTraverse(p, filename, c);\r\n if (result !== undefined) {\r\n return result;\r\n }\r\n }\r\n if (node.getIdentifier().filename === filename\r\n && p.isBetween(coverage.start, coverage.end)) {\r\n return node;\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SpaghettiScope = SpaghettiScope;\r\n//# sourceMappingURL=spaghetti_scope.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js?");
|
|
7257
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaghettiScope = exports.SpaghettiScopeNode = void 0;\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ScopeData {\r\n constructor() {\r\n this.data = {\r\n vars: {},\r\n cdefs: {},\r\n idefs: [],\r\n forms: [],\r\n types: {},\r\n extraLikeTypes: {},\r\n deferred: [],\r\n references: [],\r\n };\r\n }\r\n getData() {\r\n return this.data;\r\n }\r\n}\r\nclass SpaghettiScopeNode extends ScopeData {\r\n constructor(identifier, parent) {\r\n super();\r\n this.identifier = identifier;\r\n this.parent = parent;\r\n this.children = [];\r\n }\r\n getParent() {\r\n return this.parent;\r\n }\r\n addChild(node) {\r\n this.children.push(node);\r\n }\r\n getChildren() {\r\n return this.children;\r\n }\r\n getFirstChild() {\r\n return this.children[0];\r\n }\r\n getIdentifier() {\r\n return this.identifier;\r\n }\r\n calcCoverage() {\r\n if (this.identifier.end === undefined) {\r\n throw new Error(\"internal error, caclCoverage\");\r\n }\r\n return { start: this.identifier.start, end: this.identifier.end };\r\n }\r\n setEnd(end) {\r\n this.identifier.end = end;\r\n }\r\n findDeferred(name) {\r\n let search = this;\r\n while (search !== undefined) {\r\n for (const d of search.getData().deferred) {\r\n if (d.getStr().toUpperCase() === name.toUpperCase()) {\r\n return new _identifier_1.Identifier(d, search.identifier.filename);\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findClassDefinition(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const c = search.getData().cdefs[upper];\r\n if (c !== undefined) {\r\n return c;\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findFormDefinition(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n for (const form of search.getData().forms) {\r\n if (form.getName().toUpperCase() === upper) {\r\n return form;\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n // todo, can be deleted, not called from anywhere?\r\n listFormDefinitions() {\r\n let search = this;\r\n const ret = [];\r\n while (search !== undefined) {\r\n for (const form of search.getData().forms) {\r\n ret.push(form);\r\n }\r\n search = search.getParent();\r\n }\r\n return ret;\r\n }\r\n // todo, optimize\r\n findInterfaceDefinition(name) {\r\n let search = this;\r\n while (search !== undefined) {\r\n for (const idef of search.getData().idefs) {\r\n if (idef.getName().toUpperCase() === name.toUpperCase()) {\r\n return idef;\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findType(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const data = search.getData();\r\n if (data.types[upper]) {\r\n return data.types[upper];\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findExtraLikeType(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const data = search.getData();\r\n if (data.extraLikeTypes[upper]) {\r\n return data.extraLikeTypes[upper];\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findVariable(name) {\r\n let search = this;\r\n const upper = name.toUpperCase();\r\n while (search !== undefined) {\r\n const data = search.getData();\r\n if (data.vars[upper]) {\r\n return data.vars[upper];\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n findWriteReference(pos) {\r\n for (const r of this.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n && r.position.getStart().equals(pos)) {\r\n if (r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n return r.resolved;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n findTableReference(pos) {\r\n for (const r of this.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TableReference\r\n && r.position.getStart().equals(pos)\r\n && r.resolved) {\r\n return r.resolved.getName();\r\n }\r\n }\r\n return undefined;\r\n }\r\n findTableVoidReference(pos) {\r\n for (const r of this.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TableVoidReference\r\n && r.position.getStart().equals(pos)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n // TODO, this method can be deleted? its only used in tests?\r\n findScopeForVariable(name) {\r\n let search = this;\r\n while (search !== undefined) {\r\n for (const local in search.getData().vars) {\r\n if (local === name.toUpperCase()) {\r\n return search.getIdentifier();\r\n }\r\n }\r\n search = search.getParent();\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SpaghettiScopeNode = SpaghettiScopeNode;\r\nclass SpaghettiScope {\r\n constructor(top) {\r\n this.node = top;\r\n }\r\n // list variable definitions across all nodes\r\n listDefinitions(filename) {\r\n const ret = [];\r\n for (const n of this.allNodes()) {\r\n if (n.getIdentifier().filename === filename) {\r\n const vars = n.getData().vars;\r\n for (const v in vars) {\r\n if (vars[v].getFilename() === filename) {\r\n ret.push({ name: v, identifier: vars[v] });\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n listReadPositions(filename) {\r\n const ret = [];\r\n for (const n of this.allNodes()) {\r\n if (n.getIdentifier().filename === filename) {\r\n for (const v of n.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.DataReadReference && v.position.getFilename() === filename) {\r\n ret.push(v.position);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n listWritePositions(filename) {\r\n const ret = [];\r\n for (const n of this.allNodes()) {\r\n if (n.getIdentifier().filename === filename) {\r\n for (const v of n.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.DataWriteReference && v.position.getFilename() === filename) {\r\n ret.push(v.position);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n lookupPosition(p, filename) {\r\n if (p === undefined || filename === undefined) {\r\n return undefined;\r\n }\r\n return this.lookupPositionTraverse(p, filename, this.node);\r\n }\r\n getFirstChild() {\r\n return this.node.getFirstChild();\r\n }\r\n getTop() {\r\n return this.node;\r\n }\r\n /////////////////////////////\r\n allNodes() {\r\n const ret = [];\r\n const stack = [this.node];\r\n while (stack.length > 0) {\r\n const current = stack.pop();\r\n ret.push(current);\r\n stack.push(...current.getChildren());\r\n }\r\n return ret;\r\n }\r\n lookupPositionTraverse(p, filename, node) {\r\n const coverage = node.calcCoverage();\r\n if (node.getIdentifier().filename === filename && p.isBetween(coverage.start, coverage.end) === false) {\r\n return undefined;\r\n }\r\n // possible optimization: binary search the nodes\r\n for (const c of node.getChildren()) {\r\n const result = this.lookupPositionTraverse(p, filename, c);\r\n if (result !== undefined) {\r\n return result;\r\n }\r\n }\r\n if (node.getIdentifier().filename === filename\r\n && p.isBetween(coverage.start, coverage.end)) {\r\n return node;\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SpaghettiScope = SpaghettiScope;\r\n//# sourceMappingURL=spaghetti_scope.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js?");
|
|
7258
7258
|
|
|
7259
7259
|
/***/ }),
|
|
7260
7260
|
|
|
@@ -8002,7 +8002,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8002
8002
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8003
8003
|
|
|
8004
8004
|
"use strict";
|
|
8005
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyDatabase = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst database_table_1 = __webpack_require__(/*! ../expressions/database_table */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/database_table.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nclass ModifyDatabase {\r\n runSyntax(node, scope, filename) {\r\n for (const d of node.findAllExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(d, scope, filename);\r\n }\r\n const dbtab = node.findFirstExpression(Expressions.DatabaseTable);\r\n if (dbtab !== undefined) {\r\n
|
|
8005
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyDatabase = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js\");\r\nconst database_table_1 = __webpack_require__(/*! ../expressions/database_table */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/database_table.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ModifyDatabase {\r\n runSyntax(node, scope, filename) {\r\n for (const d of node.findAllExpressions(Expressions.Dynamic)) {\r\n new dynamic_1.Dynamic().runSyntax(d, scope, filename);\r\n }\r\n const dbtab = node.findFirstExpression(Expressions.DatabaseTable);\r\n if (dbtab !== undefined) {\r\n if (node.getChildren().length === 5) {\r\n const found = scope.findVariable(dbtab.concatTokens());\r\n if (found) {\r\n scope.addReference(dbtab.getFirstToken(), found, _reference_1.ReferenceType.DataWriteReference, filename);\r\n }\r\n else {\r\n new database_table_1.DatabaseTable().runSyntax(dbtab, scope, filename);\r\n }\r\n }\r\n else {\r\n new database_table_1.DatabaseTable().runSyntax(dbtab, scope, filename);\r\n }\r\n }\r\n for (const s of node.findAllExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const s of node.findAllExpressions(Expressions.SimpleSource3)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n}\r\nexports.ModifyDatabase = ModifyDatabase;\r\n//# sourceMappingURL=modify_database.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_database.js?");
|
|
8006
8006
|
|
|
8007
8007
|
/***/ }),
|
|
8008
8008
|
|
|
@@ -11357,7 +11357,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11357
11357
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11358
11358
|
|
|
11359
11359
|
"use strict";
|
|
11360
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Table = exports.TableCategory = exports.EnhancementCategory = void 0;\r\nconst Types = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nvar EnhancementCategory;\r\n(function (EnhancementCategory) {\r\n EnhancementCategory[\"NotClassified\"] = \"0\";\r\n EnhancementCategory[\"CannotBeEhanced\"] = \"1\";\r\n EnhancementCategory[\"Character\"] = \"2\";\r\n EnhancementCategory[\"CharacterOrNumeric\"] = \"3\";\r\n EnhancementCategory[\"Deep\"] = \"4\";\r\n})(EnhancementCategory = exports.EnhancementCategory || (exports.EnhancementCategory = {}));\r\nvar TableCategory;\r\n(function (TableCategory) {\r\n TableCategory[\"Transparent\"] = \"TRANSP\";\r\n TableCategory[\"Structure\"] = \"INTTAB\";\r\n TableCategory[\"Cluster\"] = \"CLUSTER\";\r\n TableCategory[\"Pooled\"] = \"POOL\";\r\n TableCategory[\"View\"] = \"VIEW\";\r\n TableCategory[\"Append\"] = \"APPEND\";\r\n})(TableCategory = exports.TableCategory || (exports.TableCategory = {}));\r\nclass Table extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"TABL\";\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 30,\r\n allowNamespace: true,\r\n };\r\n }\r\n setDirty() {\r\n this.parsedData = undefined;\r\n super.setDirty();\r\n }\r\n listKeys(reg) {\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n }\r\n if (this.parsedData === undefined) {\r\n return [];\r\n }\r\n const ret = [];\r\n for (const p of this.parsedData.fields) {\r\n if (p.KEYFLAG === \"X\" && p.FIELDNAME === \".INCLUDE\") {\r\n const lookup = new ddic_1.DDIC(reg).lookupTableOrView(p.PRECFIELD).type;\r\n if (lookup instanceof Types.StructureType) {\r\n for (const c of lookup.getComponents()) {\r\n ret.push(c.name);\r\n }\r\n }\r\n }\r\n else if (p.KEYFLAG === \"X\") {\r\n ret.push(p.FIELDNAME);\r\n }\r\n }\r\n return ret;\r\n }\r\n parseType(reg) {\r\n var _a, _b;\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n if (this.parsedData === undefined) {\r\n return new Types.UnknownType(\"Table, parser error\");\r\n }\r\n }\r\n const references = [];\r\n const components = [];\r\n const ddic = new ddic_1.DDIC(reg);\r\n for (const field of this.parsedData.fields) {\r\n const comptype = field.COMPTYPE ? field.COMPTYPE : \"\";\r\n if (comptype === \"E\") { // data element\r\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (field.FIELDNAME === \".INCLUDE\" || field.FIELDNAME === \".INCLU--AP\") { // incude or append structure\r\n if (field.PRECFIELD === undefined) {\r\n return new Types.UnknownType(\"Table, parser error, PRECFIELD undefined\");\r\n }\r\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\r\n let found = lookup.type;\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\r\n found = found.getType();\r\n }\r\n if (found instanceof Types.StructureType) {\r\n if (field.GROUPNAME !== undefined) {\r\n components.push({ name: field.GROUPNAME, type: found });\r\n }\r\n for (const c of found.getComponents()) {\r\n components.push({ name: c.name, type: c.type });\r\n }\r\n }\r\n else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith(\"CI_\")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith(\"SI_\")))\r\n && found instanceof Types.UnknownType) {\r\n continue;\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return found;\r\n }\r\n else if (found instanceof Types.VoidType) {\r\n // set the full structure to void\r\n return found;\r\n }\r\n else {\r\n components.push({ name: field.FIELDNAME, type: found });\r\n }\r\n }\r\n else if (comptype === \"S\" && field.FIELDNAME.startsWith(\".INCLU-\")) {\r\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n const found = lookup.type;\r\n if (found instanceof Types.VoidType) {\r\n // set the full structure to void\r\n return found;\r\n }\r\n else if (found instanceof Types.StructureType) {\r\n const suffix = field.FIELDNAME.split(\"-\")[1];\r\n for (const c of found.getComponents()) {\r\n components.push({ name: c.name + suffix, type: c.type });\r\n }\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return found;\r\n }\r\n }\r\n else if (comptype === \"S\") {\r\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (comptype === \"R\") {\r\n if (field.ROLLNAME === undefined) {\r\n throw new Error(\"Expected ROLLNAME\");\r\n }\r\n if (field.ROLLNAME === \"DATA\") {\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: new basic_1.DataReference(new basic_1.AnyType())\r\n });\r\n }\r\n else if (field.ROLLNAME === \"OBJECT\") {\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: new basic_1.GenericObjectReferenceType()\r\n });\r\n }\r\n else if (field.REFTYPE === \"S\") {\r\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (field.REFTYPE === \"L\") {\r\n const lookup = ddic.lookupTableType(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (field.REFTYPE === \"E\") {\r\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else {\r\n const lookup = ddic.lookupObject(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n }\r\n else if (comptype === \"L\") {\r\n const lookup = ddic.lookupTableType(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (comptype === \"\") { // built in\r\n const datatype = field.DATATYPE;\r\n if (datatype === undefined) {\r\n throw new Error(\"Expected DATATYPE, while parsing TABL \" + this.getName());\r\n }\r\n const length = field.LENG ? field.LENG : field.INTLEN;\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: ddic.textToType(datatype, length, field.DECIMALS, this.getName() + \"-\" + field.FIELDNAME)\r\n });\r\n }\r\n else {\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: new Types.UnknownType(\"Table \" + this.getName() + \", unknown component type \\\"\" + comptype + \"\\\"\")\r\n });\r\n }\r\n if (field.CHECKTABLE) {\r\n const lookup = ddic.lookupTableOrView2(field.CHECKTABLE);\r\n if (lookup) {\r\n references.push({ object: lookup });\r\n }\r\n }\r\n }\r\n if (components.length === 0) {\r\n return new Types.UnknownType(\"Table/Structure \" + this.getName() + \" does not contain any components\");\r\n }\r\n reg.getDDICReferences().setUsing(this, references);\r\n return new Types.StructureType(components, this.getName());\r\n }\r\n getTableCategory() {\r\n var _a;\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n }\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tableCategory;\r\n }\r\n getEnhancementCategory() {\r\n var _a;\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n }\r\n if (((_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.enhancementCategory) === undefined) {\r\n return EnhancementCategory.NotClassified;\r\n }\r\n return this.parsedData.enhancementCategory;\r\n }\r\n ///////////////\r\n parseXML() {\r\n var _a, _b, _c, _d, _e, _f, _g;\r\n const parsed = super.parseRaw2();\r\n if (parsed === undefined) {\r\n return;\r\n }\r\n this.parsedData = { fields: [] };\r\n if (parsed.abapGit === undefined) {\r\n return;\r\n }\r\n // enhancement category\r\n if (((_b = (_a = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _a === void 0 ? void 0 : _a.DD02V) === null || _b === void 0 ? void 0 : _b.EXCLASS) === undefined) {\r\n this.parsedData.enhancementCategory = EnhancementCategory.NotClassified;\r\n }\r\n else {\r\n this.parsedData.enhancementCategory = (_d = (_c = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _c === void 0 ? void 0 : _c.DD02V) === null || _d === void 0 ? void 0 : _d.EXCLASS;\r\n }\r\n // table category\r\n this.parsedData.tableCategory = (_f = (_e = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _e === void 0 ? void 0 : _e.DD02V) === null || _f === void 0 ? void 0 : _f.TABCLASS;\r\n // fields\r\n const fields = (_g = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _g === void 0 ? void 0 : _g.DD03P_TABLE;\r\n for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD03P)) {\r\n this.parsedData.fields.push({\r\n FIELDNAME: field.FIELDNAME,\r\n ROLLNAME: field.ROLLNAME,\r\n COMPTYPE: field.COMPTYPE,\r\n PRECFIELD: field.PRECFIELD,\r\n LENG: field.LENG,\r\n INTLEN: field.INTLEN,\r\n DATATYPE: field.DATATYPE,\r\n DECIMALS: field.DECIMALS,\r\n KEYFLAG: field.KEYFLAG,\r\n GROUPNAME: field.GROUPNAME,\r\n CHECKTABLE: field.CHECKTABLE,\r\n REFTYPE: field.REFTYPE,\r\n });\r\n }\r\n }\r\n}\r\nexports.Table = Table;\r\n//# sourceMappingURL=table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/objects/table.js?");
|
|
11360
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Table = exports.TableCategory = exports.EnhancementCategory = void 0;\r\nconst Types = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ \"./node_modules/@abaplint/core/build/src/objects/_abstract_object.js\");\r\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nvar EnhancementCategory;\r\n(function (EnhancementCategory) {\r\n EnhancementCategory[\"NotClassified\"] = \"0\";\r\n EnhancementCategory[\"CannotBeEhanced\"] = \"1\";\r\n EnhancementCategory[\"Character\"] = \"2\";\r\n EnhancementCategory[\"CharacterOrNumeric\"] = \"3\";\r\n EnhancementCategory[\"Deep\"] = \"4\";\r\n})(EnhancementCategory = exports.EnhancementCategory || (exports.EnhancementCategory = {}));\r\nvar TableCategory;\r\n(function (TableCategory) {\r\n TableCategory[\"Transparent\"] = \"TRANSP\";\r\n TableCategory[\"Structure\"] = \"INTTAB\";\r\n TableCategory[\"Cluster\"] = \"CLUSTER\";\r\n TableCategory[\"Pooled\"] = \"POOL\";\r\n TableCategory[\"View\"] = \"VIEW\";\r\n TableCategory[\"Append\"] = \"APPEND\";\r\n})(TableCategory = exports.TableCategory || (exports.TableCategory = {}));\r\nclass Table extends _abstract_object_1.AbstractObject {\r\n getType() {\r\n return \"TABL\";\r\n }\r\n getDescription() {\r\n // todo\r\n return undefined;\r\n }\r\n getAllowedNaming() {\r\n return {\r\n maxLength: 30,\r\n allowNamespace: true,\r\n };\r\n }\r\n setDirty() {\r\n this.parsedData = undefined;\r\n super.setDirty();\r\n }\r\n listKeys(reg) {\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n }\r\n if (this.parsedData === undefined) {\r\n return [];\r\n }\r\n const ret = [];\r\n for (const p of this.parsedData.fields) {\r\n if (p.KEYFLAG === \"X\" && p.FIELDNAME === \".INCLUDE\") {\r\n const lookup = new ddic_1.DDIC(reg).lookupTableOrView(p.PRECFIELD).type;\r\n if (lookup instanceof Types.StructureType) {\r\n for (const c of lookup.getComponents()) {\r\n ret.push(c.name);\r\n }\r\n }\r\n }\r\n else if (p.KEYFLAG === \"X\") {\r\n ret.push(p.FIELDNAME);\r\n }\r\n }\r\n return ret;\r\n }\r\n parseType(reg) {\r\n var _a, _b;\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n if (this.parsedData === undefined) {\r\n return new Types.UnknownType(\"Table, parser error\");\r\n }\r\n }\r\n const references = [];\r\n const components = [];\r\n const ddic = new ddic_1.DDIC(reg);\r\n for (const field of this.parsedData.fields) {\r\n const comptype = field.COMPTYPE ? field.COMPTYPE : \"\";\r\n if (comptype === \"E\") { // data element\r\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (field.FIELDNAME === \".INCLUDE\" || field.FIELDNAME === \".INCLU--AP\") { // incude or append structure\r\n if (field.PRECFIELD === undefined) {\r\n return new Types.UnknownType(\"Table, parser error, PRECFIELD undefined\");\r\n }\r\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\r\n let found = lookup.type;\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\r\n found = found.getType();\r\n }\r\n if (found instanceof Types.StructureType) {\r\n if (field.GROUPNAME !== undefined) {\r\n components.push({ name: field.GROUPNAME, type: found });\r\n }\r\n for (const c of found.getComponents()) {\r\n components.push({ name: c.name, type: c.type });\r\n }\r\n }\r\n else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith(\"CI_\")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith(\"SI_\")))\r\n && found instanceof Types.UnknownType) {\r\n continue;\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return found;\r\n }\r\n else if (found instanceof Types.VoidType) {\r\n // set the full structure to void\r\n return found;\r\n }\r\n else {\r\n components.push({ name: field.FIELDNAME, type: found });\r\n }\r\n }\r\n else if (comptype === \"S\" && field.FIELDNAME.startsWith(\".INCLU-\")) {\r\n const lookup = ddic.lookupTableOrView(field.PRECFIELD);\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n const found = lookup.type;\r\n if (found instanceof Types.VoidType) {\r\n // set the full structure to void\r\n return found;\r\n }\r\n else if (found instanceof Types.StructureType) {\r\n const suffix = field.FIELDNAME.split(\"-\")[1];\r\n for (const c of found.getComponents()) {\r\n components.push({ name: c.name + suffix, type: c.type });\r\n }\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return found;\r\n }\r\n }\r\n else if (comptype === \"S\") {\r\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (comptype === \"R\") {\r\n if (field.ROLLNAME === undefined) {\r\n throw new Error(\"Expected ROLLNAME\");\r\n }\r\n if (field.ROLLNAME === \"DATA\") {\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: new basic_1.DataReference(new basic_1.AnyType())\r\n });\r\n }\r\n else if (field.ROLLNAME === \"OBJECT\") {\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: new basic_1.GenericObjectReferenceType()\r\n });\r\n }\r\n else if (field.REFTYPE === \"S\") {\r\n const lookup = ddic.lookupTableOrView(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (field.REFTYPE === \"L\") {\r\n const lookup = ddic.lookupTableType(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (field.REFTYPE === \"E\") {\r\n const lookup = ddic.lookupDataElement(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: new basic_1.DataReference(lookup.type) });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else {\r\n const lookup = ddic.lookupObject(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n }\r\n else if (comptype === \"L\") {\r\n const lookup = ddic.lookupTableType(field.ROLLNAME);\r\n components.push({ name: field.FIELDNAME, type: lookup.type });\r\n if (lookup.object) {\r\n references.push({ object: lookup.object });\r\n }\r\n }\r\n else if (comptype === \"\") { // built in\r\n const datatype = field.DATATYPE;\r\n if (datatype === undefined) {\r\n throw new Error(\"Expected DATATYPE, while parsing TABL \" + this.getName());\r\n }\r\n const length = field.LENG ? field.LENG : field.INTLEN;\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: ddic.textToType(datatype, length, field.DECIMALS, this.getName() + \"-\" + field.FIELDNAME)\r\n });\r\n }\r\n else {\r\n components.push({\r\n name: field.FIELDNAME,\r\n type: new Types.UnknownType(\"Table \" + this.getName() + \", unknown component type \\\"\" + comptype + \"\\\"\")\r\n });\r\n }\r\n if (field.CHECKTABLE) {\r\n const lookup = ddic.lookupTableOrView2(field.CHECKTABLE);\r\n if (lookup) {\r\n references.push({ object: lookup });\r\n }\r\n }\r\n }\r\n if (components.length === 0) {\r\n return new Types.UnknownType(\"Table/Structure \" + this.getName() + \" does not contain any components\");\r\n }\r\n reg.getDDICReferences().setUsing(this, references);\r\n return new Types.StructureType(components, this.getName());\r\n }\r\n getTableCategory() {\r\n var _a;\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n }\r\n return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tableCategory;\r\n }\r\n getEnhancementCategory() {\r\n var _a;\r\n if (this.parsedData === undefined) {\r\n this.parseXML();\r\n }\r\n if (((_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.enhancementCategory) === undefined) {\r\n return EnhancementCategory.NotClassified;\r\n }\r\n return this.parsedData.enhancementCategory;\r\n }\r\n ///////////////\r\n parseXML() {\r\n var _a, _b, _c, _d, _e, _f, _g;\r\n const parsed = super.parseRaw2();\r\n if (parsed === undefined) {\r\n return;\r\n }\r\n this.parsedData = { fields: [] };\r\n if (parsed.abapGit === undefined) {\r\n return;\r\n }\r\n // enhancement category\r\n if (((_b = (_a = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _a === void 0 ? void 0 : _a.DD02V) === null || _b === void 0 ? void 0 : _b.EXCLASS) === undefined) {\r\n this.parsedData.enhancementCategory = EnhancementCategory.NotClassified;\r\n }\r\n else {\r\n this.parsedData.enhancementCategory = (_d = (_c = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _c === void 0 ? void 0 : _c.DD02V) === null || _d === void 0 ? void 0 : _d.EXCLASS;\r\n }\r\n // table category\r\n this.parsedData.tableCategory = (_f = (_e = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _e === void 0 ? void 0 : _e.DD02V) === null || _f === void 0 ? void 0 : _f.TABCLASS;\r\n // fields\r\n const fields = (_g = parsed.abapGit[\"asx:abap\"][\"asx:values\"]) === null || _g === void 0 ? void 0 : _g.DD03P_TABLE;\r\n for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD03P)) {\r\n this.parsedData.fields.push({\r\n FIELDNAME: field.FIELDNAME,\r\n ROLLNAME: field.ROLLNAME,\r\n COMPTYPE: field.COMPTYPE,\r\n PRECFIELD: field.PRECFIELD,\r\n LENG: field.LENG,\r\n INTLEN: field.INTLEN,\r\n DATATYPE: field.DATATYPE,\r\n DECIMALS: field.DECIMALS,\r\n KEYFLAG: field.KEYFLAG,\r\n GROUPNAME: field.GROUPNAME,\r\n CHECKTABLE: field.CHECKTABLE,\r\n REFTYPE: field.REFTYPE,\r\n });\r\n }\r\n }\r\n}\r\nexports.Table = Table;\r\n//# sourceMappingURL=table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/objects/table.js?");
|
|
11361
11361
|
|
|
11362
11362
|
/***/ }),
|
|
11363
11363
|
|
|
@@ -11577,7 +11577,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11577
11577
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11578
11578
|
|
|
11579
11579
|
"use strict";
|
|
11580
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.94.5\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11580
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.94.7\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11581
11581
|
|
|
11582
11582
|
/***/ }),
|
|
11583
11583
|
|
|
@@ -11786,7 +11786,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11786
11786
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11787
11787
|
|
|
11788
11788
|
"use strict";
|
|
11789
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChangeIfToCase = exports.ChangeIfToCaseConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ChangeIfToCaseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive regular expression\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.ChangeIfToCaseConf = ChangeIfToCaseConf;\r\nclass ChangeIfToCase extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChangeIfToCaseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"change_if_to_case\",\r\n title: \"Change IF to CASE\",\r\n shortDescription: `Finds IF constructs that can be changed to CASE`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
11789
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChangeIfToCase = exports.ChangeIfToCaseConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ChangeIfToCaseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive regular expression\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.ChangeIfToCaseConf = ChangeIfToCaseConf;\r\nclass ChangeIfToCase extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChangeIfToCaseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"change_if_to_case\",\r\n title: \"Change IF to CASE\",\r\n shortDescription: `Finds IF constructs that can be changed to CASE`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions\r\n\r\nIf the first comparison is a boolean compare, no issue is reported.`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n badExample: `IF l_fcat-fieldname EQ 'FOO'.\r\nELSEIF l_fcat-fieldname = 'BAR'\r\n OR l_fcat-fieldname = 'MOO'.\r\nENDIF.`,\r\n goodExample: `CASE l_fcat-fieldname.\r\n WHEN 'FOO'.\r\n WHEN 'BAR' OR 'MOO'.\r\nENDCASE.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n for (const i of stru.findAllStructuresRecursive(Structures.If)) {\r\n const conds = [];\r\n const ifStatement = i.findDirectStatement(Statements.If);\r\n if (ifStatement === undefined) {\r\n continue;\r\n }\r\n if (ifStatement.concatTokens().match(/ (abap_true|abap_false)\\s*\\./i)) {\r\n continue;\r\n }\r\n conds.push(ifStatement === null || ifStatement === void 0 ? void 0 : ifStatement.findDirectExpression(Expressions.Cond));\r\n for (const ei of i.findDirectStructures(Structures.ElseIf)) {\r\n conds.push((_a = ei.findDirectStatement(Statements.ElseIf)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Cond));\r\n }\r\n if (conds.length === 1) {\r\n continue;\r\n }\r\n const issue = this.analyze(conds);\r\n if (issue === true) {\r\n const message = \"Change IF to CASE\";\r\n issues.push(issue_1.Issue.atStatement(file, ifStatement, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n analyze(conds) {\r\n var _a, _b, _c, _d, _e;\r\n const tuples = [];\r\n for (const c of conds) {\r\n if (c === undefined) {\r\n continue;\r\n }\r\n if (c.findFirstExpression(Expressions.CondSub)) {\r\n return false;\r\n }\r\n else if (c.findDirectTokenByText(\"AND\") || c.findDirectTokenByText(\"EQUIV\")) {\r\n return false;\r\n }\r\n for (const compare of c.findAllExpressions(Expressions.Compare)) {\r\n const op = (_a = compare.findDirectExpression(Expressions.CompareOperator)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (compare.getChildren().length !== 3) {\r\n return false;\r\n }\r\n else if (op !== \"=\" && op !== \"EQ\") {\r\n return false;\r\n }\r\n const left = (_c = (_b = compare.getChildren()[0]) === null || _b === void 0 ? void 0 : _b.concatTokens()) === null || _c === void 0 ? void 0 : _c.toUpperCase();\r\n const right = (_e = (_d = compare.getChildren()[2]) === null || _d === void 0 ? void 0 : _d.concatTokens()) === null || _e === void 0 ? void 0 : _e.toUpperCase();\r\n tuples.push({ left, right });\r\n }\r\n }\r\n if (tuples.length === 1) {\r\n return false;\r\n }\r\n let chain = \"\";\r\n if (tuples[0].left === tuples[1].left) {\r\n chain = tuples[0].left;\r\n }\r\n else if (tuples[0].left === tuples[1].right) {\r\n chain = tuples[0].left;\r\n }\r\n else if (tuples[0].right === tuples[1].right) {\r\n chain = tuples[0].right;\r\n }\r\n else if (tuples[0].right === tuples[1].left) {\r\n chain = tuples[0].right;\r\n }\r\n else {\r\n return false;\r\n }\r\n for (const skip of this.getConfig().skipNames || []) {\r\n const reg = new RegExp(skip, \"i\");\r\n if (chain.match(reg)) {\r\n return false;\r\n }\r\n }\r\n for (const t of tuples) {\r\n if (t.left !== chain && t.right !== chain) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\nexports.ChangeIfToCase = ChangeIfToCase;\r\n//# sourceMappingURL=change_if_to_case.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/change_if_to_case.js?");
|
|
11790
11790
|
|
|
11791
11791
|
/***/ }),
|
|
11792
11792
|
|
|
@@ -12534,7 +12534,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12534
12534
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12535
12535
|
|
|
12536
12536
|
"use strict";
|
|
12537
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyOnlyOwnDBTables = exports.ModifyOnlyOwnDBTablesConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst
|
|
12537
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyOnlyOwnDBTables = exports.ModifyOnlyOwnDBTablesConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nclass ModifyOnlyOwnDBTablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.reportDynamic = true;\r\n /** Case insensitve regex for own tables */\r\n this.ownTables = \"^[yz]\";\r\n }\r\n}\r\nexports.ModifyOnlyOwnDBTablesConf = ModifyOnlyOwnDBTablesConf;\r\nclass ModifyOnlyOwnDBTables {\r\n constructor() {\r\n this.conf = new ModifyOnlyOwnDBTablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"modify_only_own_db_tables\",\r\n title: \"Modify only own DB tables\",\r\n shortDescription: `Modify only own DB tables`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/26/`,\r\n tags: [_irule_1.RuleTag.Security],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n var _a;\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n let spaghetti = undefined;\r\n const output = [];\r\n for (const file of obj.getABAPFiles()) {\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n const regExp = new RegExp(this.getConfig().ownTables, \"i\");\r\n for (const s of file.getStatements()) {\r\n const g = s.get();\r\n if (g instanceof Statements.DeleteDatabase\r\n || g instanceof Statements.UpdateDatabase\r\n || g instanceof Statements.InsertDatabase\r\n || g instanceof Statements.ModifyDatabase) {\r\n const databaseTable = s.findFirstExpression(Expressions.DatabaseTable);\r\n if (databaseTable === undefined) {\r\n continue;\r\n }\r\n if (((_a = databaseTable.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Dynamic) {\r\n if (this.getConfig().reportDynamic === true) {\r\n output.push(issue_1.Issue.atStatement(file, s, this.getMetadata().title, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n continue;\r\n }\r\n const concat = databaseTable.concatTokens().toUpperCase();\r\n if (regExp.test(concat) === false) {\r\n // must contain a ReferenceType.TableVoidReference\r\n if (spaghetti === undefined) {\r\n spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n }\r\n const start = databaseTable.getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n const found = scope === null || scope === void 0 ? void 0 : scope.findTableVoidReference(start);\r\n if (found) {\r\n output.push(issue_1.Issue.atStatement(file, s, this.getMetadata().title, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.ModifyOnlyOwnDBTables = ModifyOnlyOwnDBTables;\r\n//# sourceMappingURL=modify_only_own_db_tables.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/modify_only_own_db_tables.js?");
|
|
12538
12538
|
|
|
12539
12539
|
/***/ }),
|
|
12540
12540
|
|
|
@@ -12688,7 +12688,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12688
12688
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12689
12689
|
|
|
12690
12690
|
"use strict";
|
|
12691
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitParameterName = exports.OmitParameterNameConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst method_definition_1 = __webpack_require__(/*! ../abap/types/method_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definition.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass OmitParameterNameConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitParameterNameConf = OmitParameterNameConf;\r\nclass OmitParameterName {\r\n constructor() {\r\n this.conf = new OmitParameterNameConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_parameter_name\",\r\n title: \"Omit parameter name\",\r\n shortDescription: `Omit the parameter name in single parameter calls`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls\r\n\r\nEXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n badExample: `method( param = 2 ).`,\r\n goodExample: `method( 2 ).`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a, _b;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n continue;\r\n }\r\n for (const c of stru.findAllExpressions(Expressions.MethodCall)) {\r\n if (c.findFirstExpression(Expressions.MethodParameters)) {\r\n continue;\r\n }\r\n // hmm, this will break for nested method calls?\r\n const parameters = c.findAllExpressions(Expressions.ParameterS);\r\n if (parameters.length > 1 || parameters.length === 0) {\r\n continue;\r\n }\r\n const name = c.findDirectExpression(Expressions.MethodName);\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const param = c.findDirectExpression(Expressions.MethodCallParam);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n const ref = this.findMethodReference(name.getFirstToken(), spaghetti, file.getFilename());\r\n if (ref === undefined) {\r\n continue;\r\n }\r\n const i = ref.
|
|
12691
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitParameterName = exports.OmitParameterNameConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst method_definition_1 = __webpack_require__(/*! ../abap/types/method_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definition.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nclass OmitParameterNameConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitParameterNameConf = OmitParameterNameConf;\r\nclass OmitParameterName {\r\n constructor() {\r\n this.conf = new OmitParameterNameConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_parameter_name\",\r\n title: \"Omit parameter name\",\r\n shortDescription: `Omit the parameter name in single parameter calls`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls\r\n\r\nEXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n badExample: `method( param = 2 ).`,\r\n goodExample: `method( 2 ).`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a, _b;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n continue;\r\n }\r\n for (const c of stru.findAllExpressions(Expressions.MethodCall)) {\r\n if (c.findFirstExpression(Expressions.MethodParameters)) {\r\n continue;\r\n }\r\n // hmm, this will break for nested method calls?\r\n const parameters = c.findAllExpressions(Expressions.ParameterS);\r\n if (parameters.length > 1 || parameters.length === 0) {\r\n continue;\r\n }\r\n const name = c.findDirectExpression(Expressions.MethodName);\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const param = c.findDirectExpression(Expressions.MethodCallParam);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n const ref = this.findMethodReference(name.getFirstToken(), spaghetti, file.getFilename());\r\n if (ref === undefined) {\r\n continue;\r\n }\r\n const i = ref.getDefaultImporting();\r\n if (i === undefined) {\r\n continue;\r\n }\r\n const p = (_a = parameters[0].findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if ((p === null || p === void 0 ? void 0 : p.getStr().toUpperCase()) === i.toUpperCase()) {\r\n const message = \"Omit default parameter name \\\"\" + i + \"\\\"\";\r\n const end = (_b = parameters[0].findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStart();\r\n if (end) {\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, p.getStart(), end);\r\n issues.push(issue_1.Issue.atRange(file, p.getStart(), end, message, this.getMetadata().key, this.getConfig().severity, fix));\r\n }\r\n else {\r\n issues.push(issue_1.Issue.atToken(file, name.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////\r\n findMethodReference(token, spaghetti, filename) {\r\n const scope = spaghetti.lookupPosition(token.getStart(), filename);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference\r\n && r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n else if (r.position.getStart().equals(token.getStart())) {\r\n if (r.resolved instanceof _builtin_1.BuiltInMethod) {\r\n return r.resolved;\r\n }\r\n else if (r.resolved instanceof method_definition_1.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.OmitParameterName = OmitParameterName;\r\n//# sourceMappingURL=omit_parameter_name.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js?");
|
|
12692
12692
|
|
|
12693
12693
|
/***/ }),
|
|
12694
12694
|
|
|
@@ -13018,7 +13018,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13018
13018
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13019
13019
|
|
|
13020
13020
|
"use strict";
|
|
13021
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StaticCallViaInstance = exports.StaticCallViaInstanceConf = void 0;\r\n/* eslint-disable max-len */\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst types_1 = __webpack_require__(/*! ../abap/types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nclass StaticCallViaInstanceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.StaticCallViaInstanceConf = StaticCallViaInstanceConf;\r\nclass StaticCallViaInstance extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new StaticCallViaInstanceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"static_call_via_instance\",\r\n title: \"Static call via instance variable\",\r\n shortDescription: `Static method call via instance variable`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-call-static-methods-through-instance-variables`,\r\n tags: [_irule_1.RuleTag.Styleguide],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n const staticMethodCalls = this.listMethodCalls(file.getFilename(), new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n const tokens = file.getTokens();\r\n for (let i = 0; i < tokens.length - 1; i++) {\r\n const token = tokens[i];\r\n if (token.getStr() !== \"->\") {\r\n continue;\r\n }\r\n const next = tokens[i + 1];\r\n for (const s of staticMethodCalls) {\r\n if (s.equals(next.getStart())) {\r\n const message = \"Avoid calling static method via instance\";\r\n issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key));\r\n break;\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n listMethodCalls(filename, node) {\r\n const ret = [];\r\n for (const r of node.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference || r.position.getFilename() !== filename) {\r\n continue;\r\n }\r\n if (r.resolved instanceof types_1.MethodDefinition && r.resolved.isStatic() === true) {\r\n ret.push(r.position.getStart());\r\n }\r\n }\r\n for (const child of node.getChildren()) {\r\n ret.push(...this.listMethodCalls(filename, child));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.StaticCallViaInstance = StaticCallViaInstance;\r\n//# sourceMappingURL=static_call_via_instance.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/static_call_via_instance.js?");
|
|
13021
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StaticCallViaInstance = exports.StaticCallViaInstanceConf = void 0;\r\n/* eslint-disable max-len */\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst types_1 = __webpack_require__(/*! ../abap/types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nclass StaticCallViaInstanceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow in test class includes */\r\n this.allowInTestclassIncludes = false;\r\n }\r\n}\r\nexports.StaticCallViaInstanceConf = StaticCallViaInstanceConf;\r\nclass StaticCallViaInstance extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new StaticCallViaInstanceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"static_call_via_instance\",\r\n title: \"Static call via instance variable\",\r\n shortDescription: `Static method call via instance variable`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-call-static-methods-through-instance-variables`,\r\n tags: [_irule_1.RuleTag.Styleguide],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (this.getConfig().allowInTestclassIncludes === true && file.getFilename().includes(\".testclasses.\")) {\r\n return [];\r\n }\r\n const staticMethodCalls = this.listMethodCalls(file.getFilename(), new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n const tokens = file.getTokens();\r\n for (let i = 0; i < tokens.length - 1; i++) {\r\n const token = tokens[i];\r\n if (token.getStr() !== \"->\") {\r\n continue;\r\n }\r\n const next = tokens[i + 1];\r\n for (const s of staticMethodCalls) {\r\n if (s.equals(next.getStart())) {\r\n const message = \"Avoid calling static method via instance\";\r\n issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key));\r\n break;\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n listMethodCalls(filename, node) {\r\n const ret = [];\r\n for (const r of node.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference || r.position.getFilename() !== filename) {\r\n continue;\r\n }\r\n if (r.resolved instanceof types_1.MethodDefinition && r.resolved.isStatic() === true) {\r\n ret.push(r.position.getStart());\r\n }\r\n }\r\n for (const child of node.getChildren()) {\r\n ret.push(...this.listMethodCalls(filename, child));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.StaticCallViaInstance = StaticCallViaInstance;\r\n//# sourceMappingURL=static_call_via_instance.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/core/build/src/rules/static_call_via_instance.js?");
|
|
13022
13022
|
|
|
13023
13023
|
/***/ }),
|
|
13024
13024
|
|
|
@@ -13634,7 +13634,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13634
13634
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13635
13635
|
|
|
13636
13636
|
"use strict";
|
|
13637
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FieldChainTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst field_symbol_1 = __webpack_require__(/*! ./field_symbol */ \"./node_modules/@abaplint/transpiler/build/src/expressions/field_symbol.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass FieldChainTranspiler {\r\n constructor(addGet = false) {\r\n this.addGet = addGet;\r\n }\r\n transpile(node, traversal, prefix = true, filename) {\r\n const ret = new chunk_1.Chunk();\r\n const extra = [];\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof core_1.Expressions.SourceField\r\n || c.get() instanceof core_1.Expressions.Field) {\r\n const name = traversal.prefixAndName(c.getFirstToken(), filename).replace(\"~\", \"$\");\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.SourceFieldSymbol) {\r\n ret.appendChunk(new field_symbol_1.FieldSymbolTranspiler().transpile(c, traversal));\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.ClassName) {\r\n const name = traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken());\r\n ret.append(name + \".\", c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.AttributeName) {\r\n const interfaceName = traversal.isInterfaceAttribute(c.getFirstToken());\r\n let name = c.getFirstToken().getStr().toLowerCase();\r\n if (prefix && interfaceName && name.startsWith(interfaceName) === false) {\r\n name = traversal_1.Traversal.
|
|
13637
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FieldChainTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst field_symbol_1 = __webpack_require__(/*! ./field_symbol */ \"./node_modules/@abaplint/transpiler/build/src/expressions/field_symbol.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass FieldChainTranspiler {\r\n constructor(addGet = false) {\r\n this.addGet = addGet;\r\n }\r\n transpile(node, traversal, prefix = true, filename) {\r\n const ret = new chunk_1.Chunk();\r\n const extra = [];\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof core_1.Expressions.SourceField\r\n || c.get() instanceof core_1.Expressions.Field) {\r\n const name = traversal.prefixAndName(c.getFirstToken(), filename).replace(\"~\", \"$\");\r\n ret.append(traversal_1.Traversal.escapeNamespace(name), c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.SourceFieldSymbol) {\r\n ret.appendChunk(new field_symbol_1.FieldSymbolTranspiler().transpile(c, traversal));\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.ClassName) {\r\n const name = traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken());\r\n ret.append(name + \".\", c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.AttributeName) {\r\n const interfaceName = traversal.isInterfaceAttribute(c.getFirstToken());\r\n let name = c.getFirstToken().getStr().toLowerCase();\r\n if (prefix && interfaceName && name.startsWith(interfaceName) === false) {\r\n name = traversal_1.Traversal.escapeNamespace(name).replace(\"~\", \"$\");\r\n name = traversal_1.Traversal.escapeNamespace(interfaceName) + \"$\" + name;\r\n }\r\n else {\r\n name = traversal_1.Traversal.escapeNamespace(name).replace(\"~\", \"$\");\r\n }\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.Dereference) {\r\n ret.append(\".getPointer()\", c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ComponentName) {\r\n const name = c.getFirstToken().getStr().toLowerCase();\r\n if (name.match(/^\\d/) || name.includes(\"/\")) {\r\n ret.append(`[\"` + name + `\"]`, c, traversal);\r\n }\r\n else {\r\n ret.append(`.` + name, c, traversal);\r\n }\r\n }\r\n else if (c instanceof core_1.Nodes.TokenNode) {\r\n const str = c.getFirstToken().getStr();\r\n if (str === \"-\") {\r\n ret.append(\".get()\", c, traversal);\r\n }\r\n else if (str === \"->\") {\r\n ret.append(\".get().\", c, traversal);\r\n }\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode\r\n && c.get() instanceof core_1.Expressions.FieldOffset) {\r\n extra.push(\"offset: \" + new _1.FieldOffsetTranspiler().transpile(c, traversal).getCode());\r\n this.addGetOffset = true;\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode\r\n && c.get() instanceof core_1.Expressions.FieldLength\r\n && c.concatTokens() !== \"(*)\") {\r\n extra.push(\"length: \" + new _1.FieldLengthTranspiler().transpile(c, traversal).getCode());\r\n this.addGetOffset = true;\r\n }\r\n }\r\n if (this.addGetOffset) {\r\n let foo = extra.join(\", \");\r\n if (foo !== \"\") {\r\n foo = \"{\" + foo + \"}\";\r\n }\r\n ret.appendString(\".getOffset(\" + foo + \")\"); // todo, this will break\r\n }\r\n if (this.addGet) {\r\n ret.appendString(\".get()\"); // todo, this will break?\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.FieldChainTranspiler = FieldChainTranspiler;\r\n//# sourceMappingURL=field_chain.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/field_chain.js?");
|
|
13638
13638
|
|
|
13639
13639
|
/***/ }),
|
|
13640
13640
|
|
|
@@ -13722,7 +13722,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13722
13722
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13723
13723
|
|
|
13724
13724
|
"use strict";
|
|
13725
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst method_call_param_1 = __webpack_require__(/*! ./method_call_param */ \"./node_modules/@abaplint/transpiler/build/src/expressions/method_call_param.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass MethodCallTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const nameToken = (_a = node.findDirectExpression(core_1.Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n throw new Error(\"MethodCallTranspiler, name not found\");\r\n }\r\n let name = nameToken.getStr().toLowerCase();\r\n if (traversal.isBuiltinMethod(nameToken)) {\r\n name = \"abap.builtin.\" + name + \"(\";\r\n }\r\n else {\r\n name = name + \"(\";\r\n }\r\n const m = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));\r\n if ((m === null || m === void 0 ? void 0 : m.name) && traversal.isBuiltinMethod(nameToken) === false) {\r\n name = m.name.toLowerCase() + \"(\";\r\n }\r\n const step = node.findDirectExpression(core_1.Expressions.MethodCallParam);\r\n if (step === undefined) {\r\n throw new Error(\"MethodCallTranspiler, unexpected node\");\r\n }\r\n const ret = new chunk_1.Chunk();\r\n ret.append(traversal_1.Traversal.
|
|
13725
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst method_call_param_1 = __webpack_require__(/*! ./method_call_param */ \"./node_modules/@abaplint/transpiler/build/src/expressions/method_call_param.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass MethodCallTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const nameToken = (_a = node.findDirectExpression(core_1.Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n throw new Error(\"MethodCallTranspiler, name not found\");\r\n }\r\n let name = nameToken.getStr().toLowerCase();\r\n if (traversal.isBuiltinMethod(nameToken)) {\r\n name = \"abap.builtin.\" + name + \"(\";\r\n }\r\n else {\r\n name = name + \"(\";\r\n }\r\n const m = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));\r\n if ((m === null || m === void 0 ? void 0 : m.name) && traversal.isBuiltinMethod(nameToken) === false) {\r\n name = m.name.toLowerCase() + \"(\";\r\n }\r\n const step = node.findDirectExpression(core_1.Expressions.MethodCallParam);\r\n if (step === undefined) {\r\n throw new Error(\"MethodCallTranspiler, unexpected node\");\r\n }\r\n const ret = new chunk_1.Chunk();\r\n ret.append(traversal_1.Traversal.escapeNamespace(name.replace(\"~\", \"$\")), nameToken, traversal);\r\n ret.appendChunk(new method_call_param_1.MethodCallParamTranspiler(m === null || m === void 0 ? void 0 : m.def).transpile(step, traversal));\r\n ret.appendString(\")\");\r\n return ret;\r\n }\r\n}\r\nexports.MethodCallTranspiler = MethodCallTranspiler;\r\n//# sourceMappingURL=method_call.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_call.js?");
|
|
13726
13726
|
|
|
13727
13727
|
/***/ }),
|
|
13728
13728
|
|
|
@@ -13744,7 +13744,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13744
13744
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13745
13745
|
|
|
13746
13746
|
"use strict";
|
|
13747
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallChainTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass MethodCallChainTranspiler {\r\n transpile(node, traversal) {\r\n let ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.MethodCall) {\r\n const sub = traversal.traverse(c);\r\n if (sub.getCode().startsWith(\"abap.builtin.\")) {\r\n ret.appendChunk(sub);\r\n }\r\n else {\r\n const t = c === node.getFirstChild() ? \"this.\" : \"\";\r\n ret = new chunk_1.Chunk()\r\n .appendString(\"(await \")\r\n .append(t, node, traversal)\r\n .appendChunk(ret)\r\n .appendChunk(sub)\r\n .appendString(\")\");\r\n }\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldChain) {\r\n ret.appendChunk(traversal.traverse(c));\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.ClassName) {\r\n ret = new chunk_1.Chunk().append(traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken()), c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.MethodName) {\r\n const name = traversal_1.Traversal.
|
|
13747
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallChainTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass MethodCallChainTranspiler {\r\n transpile(node, traversal) {\r\n let ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.MethodCall) {\r\n const sub = traversal.traverse(c);\r\n if (sub.getCode().startsWith(\"abap.builtin.\")) {\r\n ret.appendChunk(sub);\r\n }\r\n else {\r\n const t = c === node.getFirstChild() ? \"this.\" : \"\";\r\n ret = new chunk_1.Chunk()\r\n .appendString(\"(await \")\r\n .append(t, node, traversal)\r\n .appendChunk(ret)\r\n .appendChunk(sub)\r\n .appendString(\")\");\r\n }\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldChain) {\r\n ret.appendChunk(traversal.traverse(c));\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.ClassName) {\r\n ret = new chunk_1.Chunk().append(traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken()), c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.MethodName) {\r\n const name = traversal_1.Traversal.escapeNamespace(c.getFirstToken().getStr().toLowerCase().replace(\"~\", \"$\"));\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr() === \"->\") {\r\n if (ret.getCode() === \"super\") {\r\n ret.append(\".\", c, traversal);\r\n }\r\n else {\r\n ret.append(\".get().\", c, traversal);\r\n }\r\n }\r\n else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr() === \"=>\") {\r\n ret.append(\".\", c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr() === \"-\") {\r\n ret.append(\".get()\", c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.ComponentName) {\r\n ret.append(\".\" + c.concatTokens().toLowerCase(), c, traversal);\r\n }\r\n else {\r\n ret.append(\"MethodCallChainTranspilerTodo-\" + c.get().constructor.name, c, traversal);\r\n }\r\n }\r\n const code = ret.getCode();\r\n if (code.startsWith(\"(\") && code.endsWith(\")\")) {\r\n return new chunk_1.Chunk().append(code.substr(1, code.length - 2), node, traversal);\r\n }\r\n else {\r\n return ret;\r\n }\r\n }\r\n}\r\nexports.MethodCallChainTranspiler = MethodCallChainTranspiler;\r\n//# sourceMappingURL=method_call_chain.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_call_chain.js?");
|
|
13748
13748
|
|
|
13749
13749
|
/***/ }),
|
|
13750
13750
|
|
|
@@ -13777,7 +13777,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13777
13777
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13778
13778
|
|
|
13779
13779
|
"use strict";
|
|
13780
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodSourceTranspiler = void 0;\r\n/* eslint-disable max-len */\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass MethodSourceTranspiler {\r\n constructor(prepend) {\r\n this.prepend = (prepend || \"\") + \"await \";\r\n }\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n let call = \"\";\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n const nextChild = children[i + 1];\r\n if (child.get() instanceof core_1.Expressions.ClassName) {\r\n call += traversal.lookupClassOrInterface(child.concatTokens(), child.getFirstToken());\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic && (nextChild === null || nextChild === void 0 ? void 0 : nextChild.concatTokens()) === \"=>\") {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_CLASS'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {\r\n const t = new _1.FieldChainTranspiler(true).transpile(second, traversal).getCode();\r\n call = traversal.lookupClassOrInterface(t, child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n call = traversal.lookupClassOrInterface(second.getFirstToken().getStr(), child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic) {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_METHOD'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain) {\r\n if (call.endsWith(\".\")) {\r\n call = call.substring(0, call.length - 1);\r\n }\r\n call += \"[\";\r\n call += traversal.traverse(second).getCode();\r\n call += \".get().toLowerCase()]\";\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n if (call === \"\") {\r\n call = \"this.\";\r\n }\r\n else if (call.endsWith(\".\") === false) {\r\n call += \".\";\r\n }\r\n call += second.getFirstToken().getStr().replace(/\\'/g, \"\").toLowerCase().replace(\"~\", \"$\");\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_METHOD not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (child.get() instanceof core_1.Expressions.MethodName) {\r\n if (i === 0) {\r\n this.prepend += \"this.\";\r\n }\r\n const nameToken = child.getFirstToken();\r\n const m = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));\r\n if (m) {\r\n call += traversal_1.Traversal.
|
|
13780
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodSourceTranspiler = void 0;\r\n/* eslint-disable max-len */\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass MethodSourceTranspiler {\r\n constructor(prepend) {\r\n this.prepend = (prepend || \"\") + \"await \";\r\n }\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n let call = \"\";\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n const nextChild = children[i + 1];\r\n if (child.get() instanceof core_1.Expressions.ClassName) {\r\n call += traversal.lookupClassOrInterface(child.concatTokens(), child.getFirstToken());\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic && (nextChild === null || nextChild === void 0 ? void 0 : nextChild.concatTokens()) === \"=>\") {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_CLASS'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {\r\n const t = new _1.FieldChainTranspiler(true).transpile(second, traversal).getCode();\r\n call = traversal.lookupClassOrInterface(t, child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n call = traversal.lookupClassOrInterface(second.getFirstToken().getStr(), child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic) {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_METHOD'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain) {\r\n if (call.endsWith(\".\")) {\r\n call = call.substring(0, call.length - 1);\r\n }\r\n call += \"[\";\r\n call += traversal.traverse(second).getCode();\r\n call += \".get().toLowerCase()]\";\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n if (call === \"\") {\r\n call = \"this.\";\r\n }\r\n else if (call.endsWith(\".\") === false) {\r\n call += \".\";\r\n }\r\n call += second.getFirstToken().getStr().replace(/\\'/g, \"\").toLowerCase().replace(\"~\", \"$\");\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_METHOD not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (child.get() instanceof core_1.Expressions.MethodName) {\r\n if (i === 0) {\r\n this.prepend += \"this.\";\r\n }\r\n const nameToken = child.getFirstToken();\r\n const m = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));\r\n if (m) {\r\n call += traversal_1.Traversal.escapeNamespace(m.name.toLowerCase().replace(\"~\", \"$\"));\r\n }\r\n else {\r\n const methodName = traversal_1.Traversal.escapeNamespace(child.concatTokens().toLowerCase().replace(\"~\", \"$\"));\r\n call += methodName;\r\n }\r\n }\r\n else if (child.concatTokens() === \"=>\") {\r\n call += \".\";\r\n }\r\n else if (child.concatTokens() === \"->\") {\r\n if (ret.getCode() !== \"super\") {\r\n call += \".get()\";\r\n }\r\n if (!(nextChild.get() instanceof core_1.Expressions.Dynamic)) {\r\n call += \".\";\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.FieldChain) {\r\n call += traversal.traverse(child).getCode();\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-\" + child.get().constructor.name + \"-todo\");\r\n }\r\n }\r\n ret.appendString(this.prepend);\r\n ret.appendString(call);\r\n return ret;\r\n }\r\n}\r\nexports.MethodSourceTranspiler = MethodSourceTranspiler;\r\n//# sourceMappingURL=method_source.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_source.js?");
|
|
13781
13781
|
|
|
13782
13782
|
/***/ }),
|
|
13783
13783
|
|
|
@@ -13997,7 +13997,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13997
13997
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13998
13998
|
|
|
13999
13999
|
"use strict";
|
|
14000
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TargetTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass TargetTranspiler {\r\n transpile(node, traversal) {\r\n const offset = [];\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const c = children[i];\r\n const next = children[i + 1];\r\n if (c.get() instanceof core_1.Expressions.TargetField) {\r\n const prefix = traversal.prefixAndName(c.getFirstToken()).replace(\"~\", \"$\");\r\n ret.append(prefix, c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ClassName) {\r\n const name = traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken());\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ComponentName) {\r\n const name = c.getFirstToken().getStr().toLowerCase();\r\n if (name.match(/^\\d/) || name.includes(\"/\")) {\r\n ret.append(`[\"` + name + `\"]`, c, traversal);\r\n }\r\n else {\r\n ret.append(`.` + name, c, traversal);\r\n }\r\n }\r\n else if (c.get() instanceof core_1.Expressions.AttributeName) {\r\n const intf = traversal.isInterfaceAttribute(c.getFirstToken());\r\n let name = traversal_1.Traversal.
|
|
14000
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TargetTranspiler = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass TargetTranspiler {\r\n transpile(node, traversal) {\r\n const offset = [];\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const c = children[i];\r\n const next = children[i + 1];\r\n if (c.get() instanceof core_1.Expressions.TargetField) {\r\n const prefix = traversal.prefixAndName(c.getFirstToken()).replace(\"~\", \"$\");\r\n ret.append(prefix, c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ClassName) {\r\n const name = traversal.lookupClassOrInterface(c.getFirstToken().getStr(), c.getFirstToken());\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c.get() instanceof core_1.Expressions.ComponentName) {\r\n const name = c.getFirstToken().getStr().toLowerCase();\r\n if (name.match(/^\\d/) || name.includes(\"/\")) {\r\n ret.append(`[\"` + name + `\"]`, c, traversal);\r\n }\r\n else {\r\n ret.append(`.` + name, c, traversal);\r\n }\r\n }\r\n else if (c.get() instanceof core_1.Expressions.AttributeName) {\r\n const intf = traversal.isInterfaceAttribute(c.getFirstToken());\r\n let name = traversal_1.Traversal.escapeNamespace(c.getFirstToken().getStr()).replace(\"~\", \"$\").toLowerCase();\r\n if (intf && name.startsWith(intf) === false) {\r\n name = traversal_1.Traversal.escapeNamespace(intf) + \"$\" + name;\r\n }\r\n ret.append(name, c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldOffset) {\r\n offset.push(\"offset: \" + new _1.FieldOffsetTranspiler().transpile(c, traversal).getCode());\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldLength) {\r\n offset.push(\"length: \" + new _1.FieldLengthTranspiler().transpile(c, traversal).getCode());\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.TargetFieldSymbol) {\r\n ret.appendChunk(new _1.FieldSymbolTranspiler().transpile(c, traversal));\r\n }\r\n else if (c.getFirstToken().getStr() === \"-\") {\r\n ret.append(\".get()\", c, traversal);\r\n }\r\n else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.Dereference) {\r\n ret.append(\".getPointer()\", c, traversal);\r\n }\r\n else if (c.getFirstToken().getStr() === \"=>\") {\r\n ret.append(\".\", c, traversal);\r\n }\r\n else if (c.getFirstToken().getStr() === \"->\") {\r\n if (next.concatTokens() === \"*\") {\r\n ret.append(\".getPointer()\", c, traversal);\r\n }\r\n else {\r\n ret.append(\".get().\", c, traversal);\r\n }\r\n }\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n if (offset.length > 0) {\r\n pre = \"new abap.OffsetLength(\";\r\n post = \", {\" + offset.join(\", \") + \"})\";\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendChunk(ret)\r\n .appendString(post);\r\n }\r\n}\r\nexports.TargetTranspiler = TargetTranspiler;\r\n//# sourceMappingURL=target.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/target.js?");
|
|
14001
14001
|
|
|
14002
14002
|
/***/ }),
|
|
14003
14003
|
|
|
@@ -14008,7 +14008,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14008
14008
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14009
14009
|
|
|
14010
14010
|
"use strict";
|
|
14011
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleABAP = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst requires_1 = __webpack_require__(/*! ../requires */ \"./node_modules/@abaplint/transpiler/build/src/requires.js\");\r\nconst rearranger_1 = __webpack_require__(/*! ../rearranger */ \"./node_modules/@abaplint/transpiler/build/src/rearranger.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass HandleABAP {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n runObject(obj, reg) {\r\n var _a, _b, _c;\r\n const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;\r\n let ret = [];\r\n if (obj instanceof abaplint.Objects.Program && obj.isInclude() === true) {\r\n // includes are only compiled along with the programs where its used?\r\n return [];\r\n }\r\n for (const file of obj.getSequencedFiles()) {\r\n const chunk = new chunk_1.Chunk();\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.addFilenames) === true) {\r\n chunk.appendString(\"// \" + file.getFilename() + \"\\n\");\r\n }\r\n const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());\r\n const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\").traverse(rearranged);\r\n chunk.appendChunk(contents);\r\n chunk.stripLastNewline();\r\n chunk.runIndentationLogic();\r\n const exports = this.findExports(file.getStructure());\r\n const filename = file.getFilename().replace(\".abap\", \".mjs\").toLowerCase();\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: new requires_1.Requires(reg).find(obj, spaghetti.getTop(), file.getFilename()),\r\n exports: exports,\r\n };\r\n ret.push(output);\r\n }\r\n ret = this.rearrangeClassLocals(obj, ret);\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.addCommonJS) === true) {\r\n ret.map(output => output.chunk = this.addImportsAndExports(output));\r\n }\r\n return ret;\r\n }\r\n /** merges the locals def and imp into one mjs file */\r\n rearrangeClassLocals(obj, output) {\r\n const ret = [];\r\n if (obj.getType() !== \"CLAS\") {\r\n return output;\r\n }\r\n let imp = undefined;\r\n let def = undefined;\r\n for (const o of output) {\r\n if (o.filename.endsWith(\".clas.locals_imp.mjs\")) {\r\n imp = o;\r\n }\r\n else if (o.filename.endsWith(\".clas.locals_def.mjs\")) {\r\n def = o;\r\n }\r\n else {\r\n ret.push(o);\r\n }\r\n }\r\n if (def) {\r\n def.filename = def.filename.replace(\".locals_def.mjs\", \".locals.mjs\");\r\n }\r\n if (imp) {\r\n imp.filename = imp.filename.replace(\".locals_imp.mjs\", \".locals.mjs\");\r\n }\r\n if (imp && def) {\r\n // remove duplicates\r\n const requires = [...def.requires];\r\n for (const r of imp.requires) {\r\n if (requires.find(a => a.filename === r.filename && a.name === r.name) === undefined) {\r\n requires.push(r);\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendChunk(def.chunk).appendChunk(imp.chunk);\r\n ret.push({\r\n object: imp.object,\r\n filename: imp.filename,\r\n chunk: chunk,\r\n requires: requires,\r\n exports: def.exports.concat(imp.exports),\r\n });\r\n }\r\n else if (imp) {\r\n ret.push(imp);\r\n }\r\n else if (def) {\r\n ret.push(def);\r\n }\r\n return ret;\r\n }\r\n addImportsAndExports(output) {\r\n var _a;\r\n const contents = new chunk_1.Chunk();\r\n for (const r of output.requires) {\r\n const name = (_a = r.name) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n const filename = r.filename.replace(\".abap\", \".mjs\");\r\n if (filename === output.filename) {\r\n continue;\r\n }\r\n if (name) {\r\n contents.appendString(\"const {\" + traversal_1.Traversal.
|
|
14011
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleABAP = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst requires_1 = __webpack_require__(/*! ../requires */ \"./node_modules/@abaplint/transpiler/build/src/requires.js\");\r\nconst rearranger_1 = __webpack_require__(/*! ../rearranger */ \"./node_modules/@abaplint/transpiler/build/src/rearranger.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass HandleABAP {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n runObject(obj, reg) {\r\n var _a, _b, _c;\r\n const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;\r\n let ret = [];\r\n if (obj instanceof abaplint.Objects.Program && obj.isInclude() === true) {\r\n // includes are only compiled along with the programs where its used?\r\n return [];\r\n }\r\n for (const file of obj.getSequencedFiles()) {\r\n const chunk = new chunk_1.Chunk();\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.addFilenames) === true) {\r\n chunk.appendString(\"// \" + file.getFilename() + \"\\n\");\r\n }\r\n const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());\r\n const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\").traverse(rearranged);\r\n chunk.appendChunk(contents);\r\n chunk.stripLastNewline();\r\n chunk.runIndentationLogic();\r\n const exports = this.findExports(file.getStructure());\r\n const filename = file.getFilename().replace(\".abap\", \".mjs\").toLowerCase();\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: new requires_1.Requires(reg).find(obj, spaghetti.getTop(), file.getFilename()),\r\n exports: exports,\r\n };\r\n ret.push(output);\r\n }\r\n ret = this.rearrangeClassLocals(obj, ret);\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.addCommonJS) === true) {\r\n ret.map(output => output.chunk = this.addImportsAndExports(output));\r\n }\r\n return ret;\r\n }\r\n /** merges the locals def and imp into one mjs file */\r\n rearrangeClassLocals(obj, output) {\r\n const ret = [];\r\n if (obj.getType() !== \"CLAS\") {\r\n return output;\r\n }\r\n let imp = undefined;\r\n let def = undefined;\r\n for (const o of output) {\r\n if (o.filename.endsWith(\".clas.locals_imp.mjs\")) {\r\n imp = o;\r\n }\r\n else if (o.filename.endsWith(\".clas.locals_def.mjs\")) {\r\n def = o;\r\n }\r\n else {\r\n ret.push(o);\r\n }\r\n }\r\n if (def) {\r\n def.filename = def.filename.replace(\".locals_def.mjs\", \".locals.mjs\");\r\n }\r\n if (imp) {\r\n imp.filename = imp.filename.replace(\".locals_imp.mjs\", \".locals.mjs\");\r\n }\r\n if (imp && def) {\r\n // remove duplicates\r\n const requires = [...def.requires];\r\n for (const r of imp.requires) {\r\n if (requires.find(a => a.filename === r.filename && a.name === r.name) === undefined) {\r\n requires.push(r);\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendChunk(def.chunk).appendChunk(imp.chunk);\r\n ret.push({\r\n object: imp.object,\r\n filename: imp.filename,\r\n chunk: chunk,\r\n requires: requires,\r\n exports: def.exports.concat(imp.exports),\r\n });\r\n }\r\n else if (imp) {\r\n ret.push(imp);\r\n }\r\n else if (def) {\r\n ret.push(def);\r\n }\r\n return ret;\r\n }\r\n addImportsAndExports(output) {\r\n var _a;\r\n const contents = new chunk_1.Chunk();\r\n for (const r of output.requires) {\r\n const name = (_a = r.name) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n const filename = r.filename.replace(\".abap\", \".mjs\");\r\n if (filename === output.filename) {\r\n continue;\r\n }\r\n if (name) {\r\n contents.appendString(\"const {\" + traversal_1.Traversal.escapeNamespace(name) + \"} = await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n else {\r\n contents.appendString(\"await import(\\\"./\" + filename.replace(/#/g, \"%23\") + \"\\\");\\n\");\r\n }\r\n }\r\n contents.appendChunk(output.chunk);\r\n if (output.exports.length > 0) {\r\n contents.appendString(\"\\nexport {\" + output.exports.map(traversal_1.Traversal.escapeNamespace).join(\", \") + \"};\");\r\n }\r\n return contents;\r\n }\r\n findExports(node) {\r\n var _a, _b;\r\n if (node === undefined) {\r\n return [];\r\n }\r\n const res = [];\r\n for (const c of node.findAllStatements(abaplint.Statements.ClassDefinition)) {\r\n const e = (_a = c.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n for (const c of node.findAllStatements(abaplint.Statements.Interface)) {\r\n const e = (_b = c.findFirstExpression(abaplint.Expressions.InterfaceName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (e) {\r\n res.push(e.toLowerCase());\r\n }\r\n }\r\n return res;\r\n }\r\n}\r\nexports.HandleABAP = HandleABAP;\r\n//# sourceMappingURL=handle_abap.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js?");
|
|
14012
14012
|
|
|
14013
14013
|
/***/ }),
|
|
14014
14014
|
|
|
@@ -14019,7 +14019,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14019
14019
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14020
14020
|
|
|
14021
14021
|
"use strict";
|
|
14022
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleDataElement = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleDataElement {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n let fixedValues = undefined;\r\n if (obj.getDomainName()) {\r\n const doma = reg.getObject(\"DOMA\", obj.getDomainName());\r\n if (doma) {\r\n fixedValues = doma.getFixedValues();\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
14022
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleDataElement = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleDataElement {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n let fixedValues = undefined;\r\n if (obj.getDomainName()) {\r\n const doma = reg.getObject(\"DOMA\", obj.getDomainName());\r\n if (doma) {\r\n fixedValues = doma.getFixedValues();\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"DTEL\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n \"domain\": ${JSON.stringify(obj.getDomainName())},\n \"fixedValues\": ${JSON.stringify(fixedValues)},\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleDataElement = HandleDataElement;\r\n//# sourceMappingURL=handle_data_element.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_data_element.js?");
|
|
14023
14023
|
|
|
14024
14024
|
/***/ }),
|
|
14025
14025
|
|
|
@@ -14030,7 +14030,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14030
14030
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14031
14031
|
|
|
14032
14032
|
"use strict";
|
|
14033
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleEnqu = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\n// view, much like the tables\r\nclass HandleEnqu {\r\n runObject(obj, _reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const chunk = new chunk_1.Chunk().appendString(`// enqueue object\
|
|
14033
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleEnqu = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\n// view, much like the tables\r\nclass HandleEnqu {\r\n runObject(obj, _reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const chunk = new chunk_1.Chunk().appendString(`// enqueue object\nabap.FunctionModules[\"ENQUEUE_${obj.getName().toUpperCase()}\"] = async (INPUT) => {\n const lookup = abap.Classes[\"KERNEL_LOCK\"];\n if (lookup === undefined) {\n throw new Error(\"Lock, kernel class missing\");\n }\n await lookup.enqueue(INPUT);\n};\nabap.FunctionModules[\"DEQUEUE_${obj.getName().toUpperCase()}\"] = async (INPUT) => {\n const lookup = abap.Classes[\"KERNEL_LOCK\"];\n if (lookup === undefined) {\n throw new Error(\"Lock, kernel class missing\");\n }\n await lookup.dequeue(INPUT);\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleEnqu = HandleEnqu;\r\n//# sourceMappingURL=handle_enqu.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_enqu.js?");
|
|
14034
14034
|
|
|
14035
14035
|
/***/ }),
|
|
14036
14036
|
|
|
@@ -14041,7 +14041,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14041
14041
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14042
14042
|
|
|
14043
14043
|
"use strict";
|
|
14044
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTable = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\n// tables or structures\r\nclass HandleTable {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
14044
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTable = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\n// tables or structures\r\nclass HandleTable {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"TABL\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n \"keyFields\": ${JSON.stringify(obj.listKeys(reg))},\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleTable = HandleTable;\r\n//# sourceMappingURL=handle_table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_table.js?");
|
|
14045
14045
|
|
|
14046
14046
|
/***/ }),
|
|
14047
14047
|
|
|
@@ -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.HandleTableType = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleTableType {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
14055
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTableType = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleTableType {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"TTYP\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleTableType = HandleTableType;\r\n//# sourceMappingURL=handle_table_type.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_table_type.js?");
|
|
14056
14056
|
|
|
14057
14057
|
/***/ }),
|
|
14058
14058
|
|
|
@@ -14063,7 +14063,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14063
14063
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14064
14064
|
|
|
14065
14065
|
"use strict";
|
|
14066
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleView = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\n// view, much like the tables\r\nclass HandleView {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
14066
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleView = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\n// view, much like the tables\r\nclass HandleView {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"VIEW\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n};`);\r\n // todo, \"keyFields\": ${JSON.stringify(obj.listKeys())},\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleView = HandleView;\r\n//# sourceMappingURL=handle_view.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handlers/handle_view.js?");
|
|
14067
14067
|
|
|
14068
14068
|
/***/ }),
|
|
14069
14069
|
|
|
@@ -14206,7 +14206,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14206
14206
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14207
14207
|
|
|
14208
14208
|
"use strict";
|
|
14209
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTranspiler = 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 expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass CallTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c, _d, _e;\r\n const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);\r\n if (chain) {\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);\r\n if (receiving) {\r\n pre = traversal.traverse(receiving).getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n const exceptions = node.findFirstExpression(abaplint.Expressions.ParameterListExceptions);\r\n if (exceptions) {\r\n pre = \"try {\\n\" + pre;\r\n }\r\n post += \";\";\r\n if (exceptions) {\r\n post += `\\nabap.builtin.sy.get().subrc.set(0);\
|
|
14209
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTranspiler = 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 expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass CallTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c, _d, _e;\r\n const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);\r\n if (chain) {\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);\r\n if (receiving) {\r\n pre = traversal.traverse(receiving).getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n const exceptions = node.findFirstExpression(abaplint.Expressions.ParameterListExceptions);\r\n if (exceptions) {\r\n pre = \"try {\\n\" + pre;\r\n }\r\n post += \";\";\r\n if (exceptions) {\r\n post += `\\nabap.builtin.sy.get().subrc.set(0);\n} catch (e) {\nif (e.classic) {\n switch (e.classic.toUpperCase()) {\\n`;\r\n for (const e of exceptions.findAllExpressions(abaplint.Expressions.ParameterException)) {\r\n const name = e.getFirstToken().getStr().toUpperCase();\r\n const value = (_c = e.findFirstExpression(abaplint.Expressions.SimpleName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr().toUpperCase();\r\n if (value === undefined) {\r\n continue;\r\n }\r\n if (name === \"OTHERS\") {\r\n post += `default: abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n else {\r\n post += `case \"${name}\": abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n }\r\n post += ` }\n} else {\n throw e;\n}\n}`;\r\n }\r\n const chainChunk = traversal.traverse(chain);\r\n let chainCode = chainChunk.getCode();\r\n if (chainCode.startsWith(\"await super.constructor(\")) {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n chainCode = chainCode.replace(\"await super.constructor(\", \"await super.constructor_(\");\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendString(chainCode)\r\n .append(post, node.getLastToken(), traversal);\r\n }\r\n const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);\r\n if (methodSource) {\r\n let body = \"\";\r\n const nameToken = (_d = methodSource.getLastChild()) === null || _d === void 0 ? void 0 : _d.getFirstToken();\r\n const m = nameToken ? traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken)) : undefined;\r\n const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);\r\n if (methodCallBody) {\r\n body = new expressions_1.MethodCallBodyTranspiler(m === null || m === void 0 ? void 0 : m.def).transpile(methodCallBody, traversal).getCode();\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_e = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _e === void 0 ? void 0 : _e.findExpressionAfterToken(\"RECEIVING\");\r\n if (receiving) {\r\n const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));\r\n pre = target.getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n let ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal).getCode();\r\n if (ms === \"await super.get().constructor\") {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n ms = \"await super.constructor_\";\r\n }\r\n return new chunk_1.Chunk().appendString(ms).appendString(\"(\" + body + \")\" + post + \";\");\r\n }\r\n throw new Error(\"CallTranspiler, todo\");\r\n }\r\n}\r\nexports.CallTranspiler = CallTranspiler;\r\n//# sourceMappingURL=call.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/call.js?");
|
|
14210
14210
|
|
|
14211
14211
|
/***/ }),
|
|
14212
14212
|
|
|
@@ -14316,7 +14316,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14316
14316
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14317
14317
|
|
|
14318
14318
|
"use strict";
|
|
14319
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const token = node.findFirstExpression(abaplint.Expressions.ClassName).getFirstToken();\r\n const def = traversal.getClassDefinition(token);\r\n let ret = \"class \" + traversal_1.Traversal.
|
|
14319
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const token = node.findFirstExpression(abaplint.Expressions.ClassName).getFirstToken();\r\n const def = traversal.getClassDefinition(token);\r\n let ret = \"class \" + traversal_1.Traversal.escapeNamespace(token.getStr().toLowerCase());\r\n if (token.getStr().toLowerCase() === \"cx_root\") {\r\n // special case for exceptions\r\n ret += \" extends Error\";\r\n }\r\n else if (def === null || def === void 0 ? void 0 : def.getSuperClass()) {\r\n ret += \" extends \" + traversal_1.Traversal.escapeNamespace((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());\r\n }\r\n return new chunk_1.Chunk().append(ret + ` {\nstatic INTERNAL_TYPE = 'CLAS';\nstatic IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `\"` + e.name.toUpperCase() + `\"`).join(\",\")}];`, node, traversal);\r\n }\r\n}\r\nexports.ClassImplementationTranspiler = ClassImplementationTranspiler;\r\n//# sourceMappingURL=class_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/class_implementation.js?");
|
|
14320
14320
|
|
|
14321
14321
|
/***/ }),
|
|
14322
14322
|
|
|
@@ -14525,7 +14525,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14525
14525
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14526
14526
|
|
|
14527
14527
|
"use strict";
|
|
14528
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = 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 DoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\
|
|
14528
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = 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 DoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\nconst ${idSource} = ${source};\nfor (let ${id} = 0; ${id} < ${idSource}; ${id}++) {\nabap.builtin.sy.get().index.set(${id} + 1);`);\r\n }\r\n else {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\nlet ${unique} = 1;\nwhile (true) {\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/do.js?");
|
|
14529
14529
|
|
|
14530
14530
|
/***/ }),
|
|
14531
14531
|
|
|
@@ -14602,7 +14602,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14602
14602
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14603
14603
|
|
|
14604
14604
|
"use strict";
|
|
14605
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndDoTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndDoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\
|
|
14605
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndDoTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndDoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\nabap.builtin.sy.get().index.set(${this.syIndexBackup});\\n`, node, traversal);\r\n }\r\n}\r\nexports.EndDoTranspiler = EndDoTranspiler;\r\n//# sourceMappingURL=end_do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_do.js?");
|
|
14606
14606
|
|
|
14607
14607
|
/***/ }),
|
|
14608
14608
|
|
|
@@ -14679,7 +14679,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14679
14679
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14680
14680
|
|
|
14681
14681
|
"use strict";
|
|
14682
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndWhileTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndWhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\
|
|
14682
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndWhileTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndWhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\nabap.builtin.sy.get().index.set(${this.syIndexBackup});\\n`, node, traversal);\r\n }\r\n}\r\nexports.EndWhileTranspiler = EndWhileTranspiler;\r\n//# sourceMappingURL=end_while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_while.js?");
|
|
14683
14683
|
|
|
14684
14684
|
/***/ }),
|
|
14685
14685
|
|
|
@@ -15020,7 +15020,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15020
15020
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15021
15021
|
|
|
15022
15022
|
"use strict";
|
|
15023
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-langu\") {\r\n val = \"abap.builtin.sy.get().langu\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-mandt\") {\r\n val = \"abap.builtin.sy.get().mandt\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-sysid\") {\r\n val = \"abap.builtin.sy.get().sysid\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgid\") {\r\n val = \"abap.builtin.sy.get().msgid\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgty\") {\r\n val = \"abap.builtin.sy.get().msgty\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgno\") {\r\n val = \"abap.builtin.sy.get().msgno\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv1\") {\r\n val = \"abap.builtin.sy.get().msgv1\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv2\") {\r\n val = \"abap.builtin.sy.get().msgv2\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv3\") {\r\n val = \"abap.builtin.sy.get().msgv3\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv4\") {\r\n val = \"abap.builtin.sy.get().msgv4\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n const superDef = traversal.findClassDefinition(classDef === null || classDef === void 0 ? void 0 : classDef.getSuperClass(), scope);\r\n for (const a of (superDef === null || superDef === void 0 ? void 0 : superDef.getAliases().getAll()) || []) {\r\n if (a.getName().toLowerCase() === methodName) {\r\n methodName = a.getComponent().replace(\"~\", \"$\").toLowerCase();\r\n }\r\n }\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n /////////////////////////////\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
|
|
15023
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-langu\") {\r\n val = \"abap.builtin.sy.get().langu\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-mandt\") {\r\n val = \"abap.builtin.sy.get().mandt\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-sysid\") {\r\n val = \"abap.builtin.sy.get().sysid\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgid\") {\r\n val = \"abap.builtin.sy.get().msgid\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgty\") {\r\n val = \"abap.builtin.sy.get().msgty\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgno\") {\r\n val = \"abap.builtin.sy.get().msgno\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv1\") {\r\n val = \"abap.builtin.sy.get().msgv1\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv2\") {\r\n val = \"abap.builtin.sy.get().msgv2\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv3\") {\r\n val = \"abap.builtin.sy.get().msgv3\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-msgv4\") {\r\n val = \"abap.builtin.sy.get().msgv4\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n const superDef = traversal.findClassDefinition(classDef === null || classDef === void 0 ? void 0 : classDef.getSuperClass(), scope);\r\n for (const a of (superDef === null || superDef === void 0 ? void 0 : superDef.getAliases().getAll()) || []) {\r\n if (a.getName().toLowerCase() === methodName) {\r\n methodName = a.getComponent().replace(\"~\", \"$\").toLowerCase();\r\n }\r\n }\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeNamespace(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeNamespace(className) + \".\" + traversal_1.Traversal.escapeNamespace(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeNamespace(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n /////////////////////////////\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
|
|
15024
15024
|
|
|
15025
15025
|
/***/ }),
|
|
15026
15026
|
|
|
@@ -15185,7 +15185,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15185
15185
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15186
15186
|
|
|
15187
15187
|
"use strict";
|
|
15188
|
-
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 traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.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 field = traversal_1.Traversal.
|
|
15188
|
+
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 traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.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 field = traversal_1.Traversal.escapeNamespace(field).replace(\"~\", \"$\");\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?");
|
|
15189
15189
|
|
|
15190
15190
|
/***/ }),
|
|
15191
15191
|
|
|
@@ -15306,7 +15306,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15306
15306
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15307
15307
|
|
|
15308
15308
|
"use strict";
|
|
15309
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectTranspiler = 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 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 sql_from_1 = __webpack_require__(/*! ../expressions/sql_from */ \"./node_modules/@abaplint/transpiler/build/src/expressions/sql_from.js\");\r\nclass SelectTranspiler {\r\n transpile(node, traversal, targetOverride) {\r\n var _a;\r\n let target = \"undefined\";\r\n if (targetOverride) {\r\n target = targetOverride;\r\n }\r\n else if (node.findFirstExpression(abaplint.Expressions.Target)) {\r\n target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode();\r\n }\r\n let select = \"SELECT \";\r\n const fieldList = node.findFirstExpression(abaplint.Expressions.SQLFieldList)\r\n || node.findFirstExpression(abaplint.Expressions.SQLFieldListLoop);\r\n if ((fieldList === null || fieldList === void 0 ? void 0 : fieldList.getChildren().length) === 1) {\r\n select += fieldList.concatTokens();\r\n }\r\n else {\r\n // add commas between field names, this is required for SQLite, and easy to remove in other clients?\r\n select += fieldList === null || fieldList === void 0 ? void 0 : fieldList.findAllExpressions(abaplint.Expressions.SQLField).map(e => e.concatTokens()).join(\", \");\r\n }\r\n select += \" \";\r\n const from = node.findFirstExpression(abaplint.Expressions.SQLFrom);\r\n if (from) {\r\n select += new sql_from_1.SQLFromTranspiler().transpile(from, traversal).getCode();\r\n }\r\n let where = undefined;\r\n for (const sqlCond of node.findAllExpressions(abaplint.Expressions.SQLCond)) {\r\n if (this.isWhereExpression(node, sqlCond)) {\r\n where = sqlCond;\r\n }\r\n }\r\n if (where) {\r\n select += \"WHERE \" + traversal.traverse(where).getCode() + \" \";\r\n }\r\n const upTo = node.findFirstExpression(abaplint.Expressions.SQLUpTo);\r\n if (upTo) {\r\n const s = upTo.findFirstExpression(abaplint.Expressions.SimpleSource3);\r\n if (s) {\r\n select += `UP TO \" + ${new expressions_1.SourceTranspiler(true).transpile(s, traversal).getCode()} + \" ROWS `;\r\n }\r\n else {\r\n select += upTo.concatTokens() + \" \";\r\n }\r\n }\r\n const orderBy = node.findFirstExpression(abaplint.Expressions.SQLOrderBy);\r\n if (orderBy) {\r\n select += orderBy.concatTokens() + \" \";\r\n }\r\n for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {\r\n const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);\r\n if (chain) {\r\n const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();\r\n const search = d.concatTokens();\r\n select = select.replace(search, `\" + ${code} + \"`);\r\n }\r\n }\r\n if (node.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \")) {\r\n select += \"UP TO 1 ROWS\";\r\n }\r\n let runtimeOptions = \"\";\r\n if (node.concatTokens().toUpperCase().includes(\" APPENDING TABLE \")) {\r\n runtimeOptions = `, {appending: true}`;\r\n }\r\n let extra = \"\";\r\n const keys = this.findKeys(node, traversal);\r\n if (keys.length > 0) {\r\n extra = `, primaryKey: ${JSON.stringify(keys)}`;\r\n }\r\n if (node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n const fn = (_a = node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.SQLSource);\r\n const faeTranspiled = new expressions_1.SQLSourceTranspiler().transpile(fn, traversal).getCode();\r\n select = select.replace(new RegExp(\" \" + faeTranspiled, \"g\"), \" \" + unique);\r\n select = select.replace(unique + \".get().table_line.get()\", unique + \".get()\"); // there can be only one?\r\n const code = `if (${faeTranspiled}.array().length === 0) {\
|
|
15309
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectTranspiler = 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 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 sql_from_1 = __webpack_require__(/*! ../expressions/sql_from */ \"./node_modules/@abaplint/transpiler/build/src/expressions/sql_from.js\");\r\nclass SelectTranspiler {\r\n transpile(node, traversal, targetOverride) {\r\n var _a;\r\n let target = \"undefined\";\r\n if (targetOverride) {\r\n target = targetOverride;\r\n }\r\n else if (node.findFirstExpression(abaplint.Expressions.Target)) {\r\n target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode();\r\n }\r\n let select = \"SELECT \";\r\n const fieldList = node.findFirstExpression(abaplint.Expressions.SQLFieldList)\r\n || node.findFirstExpression(abaplint.Expressions.SQLFieldListLoop);\r\n if ((fieldList === null || fieldList === void 0 ? void 0 : fieldList.getChildren().length) === 1) {\r\n select += fieldList.concatTokens();\r\n }\r\n else {\r\n // add commas between field names, this is required for SQLite, and easy to remove in other clients?\r\n select += fieldList === null || fieldList === void 0 ? void 0 : fieldList.findAllExpressions(abaplint.Expressions.SQLField).map(e => e.concatTokens()).join(\", \");\r\n }\r\n select += \" \";\r\n const from = node.findFirstExpression(abaplint.Expressions.SQLFrom);\r\n if (from) {\r\n select += new sql_from_1.SQLFromTranspiler().transpile(from, traversal).getCode();\r\n }\r\n let where = undefined;\r\n for (const sqlCond of node.findAllExpressions(abaplint.Expressions.SQLCond)) {\r\n if (this.isWhereExpression(node, sqlCond)) {\r\n where = sqlCond;\r\n }\r\n }\r\n if (where) {\r\n select += \"WHERE \" + traversal.traverse(where).getCode() + \" \";\r\n }\r\n const upTo = node.findFirstExpression(abaplint.Expressions.SQLUpTo);\r\n if (upTo) {\r\n const s = upTo.findFirstExpression(abaplint.Expressions.SimpleSource3);\r\n if (s) {\r\n select += `UP TO \" + ${new expressions_1.SourceTranspiler(true).transpile(s, traversal).getCode()} + \" ROWS `;\r\n }\r\n else {\r\n select += upTo.concatTokens() + \" \";\r\n }\r\n }\r\n const orderBy = node.findFirstExpression(abaplint.Expressions.SQLOrderBy);\r\n if (orderBy) {\r\n select += orderBy.concatTokens() + \" \";\r\n }\r\n for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {\r\n const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);\r\n if (chain) {\r\n const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();\r\n const search = d.concatTokens();\r\n select = select.replace(search, `\" + ${code} + \"`);\r\n }\r\n }\r\n if (node.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \")) {\r\n select += \"UP TO 1 ROWS\";\r\n }\r\n let runtimeOptions = \"\";\r\n if (node.concatTokens().toUpperCase().includes(\" APPENDING TABLE \")) {\r\n runtimeOptions = `, {appending: true}`;\r\n }\r\n let extra = \"\";\r\n const keys = this.findKeys(node, traversal);\r\n if (keys.length > 0) {\r\n extra = `, primaryKey: ${JSON.stringify(keys)}`;\r\n }\r\n if (node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n const fn = (_a = node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.SQLSource);\r\n const faeTranspiled = new expressions_1.SQLSourceTranspiler().transpile(fn, traversal).getCode();\r\n select = select.replace(new RegExp(\" \" + faeTranspiled, \"g\"), \" \" + unique);\r\n select = select.replace(unique + \".get().table_line.get()\", unique + \".get()\"); // there can be only one?\r\n const code = `if (${faeTranspiled}.array().length === 0) {\n throw \"FAE, todo, empty table\";\n} else {\n abap.statements.clear(${target});\n for await (const ${unique} of abap.statements.loop(${faeTranspiled})) {\n await abap.statements.select(${target}, {select: \"${select.trim()}\"${extra}}, {appending: true});\n }\n abap.builtin.sy.get().dbcnt.set(${target}.array().length);\n}`;\r\n return new chunk_1.Chunk().append(code, node, traversal);\r\n }\r\n else {\r\n return new chunk_1.Chunk().append(`await abap.statements.select(${target}, {select: \"${select.trim()}\"${extra}}${runtimeOptions});`, node, traversal);\r\n }\r\n }\r\n findKeys(node, traversal) {\r\n let keys = [];\r\n const from = node.findAllExpressions(abaplint.Expressions.SQLFromSource).map(e => e.concatTokens());\r\n if (from.length === 1) {\r\n const tabl = traversal.findTable(from[0]);\r\n if (tabl) {\r\n keys = tabl.listKeys(traversal.reg).map(k => k.toLowerCase());\r\n }\r\n }\r\n return keys;\r\n }\r\n isWhereExpression(node, expression) {\r\n // check if previous token before sqlCond is \"WHERE\". It could also be \"ON\" in case of join condition\r\n let prevToken;\r\n const sqlCondToken = expression.getFirstToken();\r\n for (const token of node.getTokens()) {\r\n if (token.getStart() === sqlCondToken.getStart()) {\r\n break;\r\n }\r\n prevToken = token;\r\n }\r\n if (prevToken && prevToken.getStr() === \"WHERE\") {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n}\r\nexports.SelectTranspiler = SelectTranspiler;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/select.js?");
|
|
15310
15310
|
|
|
15311
15311
|
/***/ }),
|
|
15312
15312
|
|
|
@@ -15625,7 +15625,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15625
15625
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15626
15626
|
|
|
15627
15627
|
"use strict";
|
|
15628
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = 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 chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk()\r\n .append(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\
|
|
15628
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = 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 chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk()\r\n .append(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\nlet ${unique} = 1;\nwhile (`, node, traversal)\r\n .appendChunk(cond)\r\n .appendString(`) {\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n}\r\nexports.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/while.js?");
|
|
15629
15629
|
|
|
15630
15630
|
/***/ }),
|
|
15631
15631
|
|
|
@@ -15658,7 +15658,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15658
15658
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15659
15659
|
|
|
15660
15660
|
"use strict";
|
|
15661
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDefinitionTranspiler = 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\nclass ClassDefinitionTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const className = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n let found = false;\r\n if (className !== undefined) {\r\n for (const a of traversal.getCurrentObject().getABAPFiles()) {\r\n if (a.getInfo().getClassImplementationByName(className) !== undefined) {\r\n found = true;\r\n }\r\n }\r\n }\r\n if (found) {\r\n return new chunk_1.Chunk(\"\");\r\n }\r\n else {\r\n // its an abstract class with only abstract methods\r\n return new chunk_1.Chunk(`\
|
|
15661
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDefinitionTranspiler = 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\nclass ClassDefinitionTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const className = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n let found = false;\r\n if (className !== undefined) {\r\n for (const a of traversal.getCurrentObject().getABAPFiles()) {\r\n if (a.getInfo().getClassImplementationByName(className) !== undefined) {\r\n found = true;\r\n }\r\n }\r\n }\r\n if (found) {\r\n return new chunk_1.Chunk(\"\");\r\n }\r\n else {\r\n // its an abstract class with only abstract methods\r\n return new chunk_1.Chunk(`\nclass ${className === null || className === void 0 ? void 0 : className.toLowerCase()} {\n static INTERNAL_TYPE = 'CLAS';\n async constructor_() {\n this.me = new abap.types.ABAPObject();\n this.me.set(this);\n return this;\n }\n}`);\r\n }\r\n }\r\n}\r\nexports.ClassDefinitionTranspiler = ClassDefinitionTranspiler;\r\n//# sourceMappingURL=class_definition.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/class_definition.js?");
|
|
15662
15662
|
|
|
15663
15663
|
/***/ }),
|
|
15664
15664
|
|
|
@@ -15669,7 +15669,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15669
15669
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15670
15670
|
|
|
15671
15671
|
"use strict";
|
|
15672
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n ret.appendChunk(traversal.traverse(c));\r\n if (c instanceof abaplint.Nodes.StatementNode\r\n && c.get() instanceof abaplint.Statements.ClassImplementation\r\n && this.hasConstructor(node) === false) {\r\n ret.appendString(this.buildConstructor(c, traversal));\r\n }\r\n }\r\n ret.appendString(this.buildStatic(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n ret.appendString(this.buildTypes(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n return ret;\r\n }\r\n ///////////////////////////////\r\n hasConstructor(node) {\r\n var _a;\r\n for (const m of node.findAllStatements(abaplint.Statements.MethodImplementation)) {\r\n const name = (_a = m.findFirstExpression(abaplint.Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if ((name === null || name === void 0 ? void 0 : name.toUpperCase()) === \"CONSTRUCTOR\") {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Finds static attributes + constants including those from interfaces (from superclass is ingored) */\r\n findStaticAttributes(cdef, scope) {\r\n const ret = [];\r\n ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n const implementing = [...cdef.getImplementing()];\r\n while (implementing.length > 0) {\r\n const i = implementing.shift();\r\n if (i === undefined) {\r\n break;\r\n }\r\n const intf = scope.findInterfaceDefinition(i.name);\r\n if (intf === undefined) {\r\n continue;\r\n }\r\n // todo, constants from interface?\r\n implementing.push(...intf.getImplementing());\r\n ret.push(...intf.getAttributes().getStatic().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n ret.push(...intf.getAttributes().getConstants().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n }\r\n return ret;\r\n }\r\n buildTypes(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const cdef = traversal.getClassDefinition(node.getFirstToken());\r\n if (cdef === undefined) {\r\n return \"ERROR_CDEF_NOT_FOUND\";\r\n }\r\n const prefix = traversal_1.Traversal.
|
|
15672
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ClassImplementationTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n ret.appendChunk(traversal.traverse(c));\r\n if (c instanceof abaplint.Nodes.StatementNode\r\n && c.get() instanceof abaplint.Statements.ClassImplementation\r\n && this.hasConstructor(node) === false) {\r\n ret.appendString(this.buildConstructor(c, traversal));\r\n }\r\n }\r\n ret.appendString(this.buildStatic(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n ret.appendString(this.buildTypes(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));\r\n return ret;\r\n }\r\n ///////////////////////////////\r\n hasConstructor(node) {\r\n var _a;\r\n for (const m of node.findAllStatements(abaplint.Statements.MethodImplementation)) {\r\n const name = (_a = m.findFirstExpression(abaplint.Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();\r\n if ((name === null || name === void 0 ? void 0 : name.toUpperCase()) === \"CONSTRUCTOR\") {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Finds static attributes + constants including those from interfaces (from superclass is ingored) */\r\n findStaticAttributes(cdef, scope) {\r\n const ret = [];\r\n ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: \"\" }; }));\r\n const implementing = [...cdef.getImplementing()];\r\n while (implementing.length > 0) {\r\n const i = implementing.shift();\r\n if (i === undefined) {\r\n break;\r\n }\r\n const intf = scope.findInterfaceDefinition(i.name);\r\n if (intf === undefined) {\r\n continue;\r\n }\r\n // todo, constants from interface?\r\n implementing.push(...intf.getImplementing());\r\n ret.push(...intf.getAttributes().getStatic().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n ret.push(...intf.getAttributes().getConstants().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + \"$\" }; }));\r\n }\r\n return ret;\r\n }\r\n buildTypes(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const cdef = traversal.getClassDefinition(node.getFirstToken());\r\n if (cdef === undefined) {\r\n return \"ERROR_CDEF_NOT_FOUND\";\r\n }\r\n const prefix = traversal_1.Traversal.escapeNamespace(cdef.getName().toLowerCase()) + \".\";\r\n let ret = \"\";\r\n for (const ty of cdef.getTypeDefinitions().getAll()) {\r\n ret += new transpile_types_1.TranspileTypes().declareStaticSkipVoid(prefix, ty.type);\r\n }\r\n return ret;\r\n }\r\n /** this builds the part after the class, containing the static variables/constants */\r\n buildStatic(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const cdef = traversal.getClassDefinition(node.getFirstToken());\r\n if (cdef === undefined) {\r\n return \"ERROR_CDEF_NOT_FOUND\";\r\n }\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n if (scope === undefined) {\r\n return \"ERROR_SCOPE_NOT_FOUND\";\r\n }\r\n let ret = \"\";\r\n const clasName = node.getFirstToken().getStr().toLowerCase();\r\n const staticAttributes = this.findStaticAttributes(cdef, scope);\r\n for (const attr of staticAttributes) {\r\n const name = traversal_1.Traversal.escapeNamespace(clasName) + \".\" + attr.prefix + traversal_1.Traversal.escapeNamespace(attr.identifier.getName().toLowerCase());\r\n ret += name + \" = \" + new transpile_types_1.TranspileTypes().toType(attr.identifier.getType()) + \";\\n\";\r\n ret += traversal.setValues(attr.identifier, name);\r\n }\r\n for (const alias of cdef.getAliases().getAll()) {\r\n const isStatic = staticAttributes.some(s => s.prefix.replace(\"$\", \"~\") + s.identifier.getName() === alias.getComponent());\r\n if (isStatic === false) {\r\n continue;\r\n }\r\n ret += clasName + \".\" + alias.getName().toLowerCase() + \" = \" + clasName + \".\" + alias.getComponent().replace(\"~\", \"$\") + \";\\n\";\r\n }\r\n // this is not correct, ABAP does not invocate the class constructor at require time,\r\n // but this will probably work\r\n if (cdef.getMethodDefinitions().getByName(\"class_constructor\")) {\r\n ret += \"await \" + traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase()) + \".class_constructor();\\n\";\r\n }\r\n return ret;\r\n }\r\n buildConstructor(node, traversal) {\r\n var _a;\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const token = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (token === undefined) {\r\n throw \"buildConstructorTokenNotFound\";\r\n }\r\n const cdef = traversal.getClassDefinition(token);\r\n if (cdef === undefined) {\r\n throw \"buildConstructorCDEFNotFound\";\r\n }\r\n const ret = traversal.buildConstructorContents(scope, cdef);\r\n if (ret === \"\") {\r\n return ret;\r\n }\r\n return \"async constructor_(INPUT) {\\n\" + ret + \"return this;\\n}\\n\";\r\n }\r\n}\r\nexports.ClassImplementationTranspiler = ClassImplementationTranspiler;\r\n//# sourceMappingURL=class_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/class_implementation.js?");
|
|
15673
15673
|
|
|
15674
15674
|
/***/ }),
|
|
15675
15675
|
|
|
@@ -15724,7 +15724,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15724
15724
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15725
15725
|
|
|
15726
15726
|
"use strict";
|
|
15727
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass FunctionModuleTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let r = \"\";\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();\r\n if (name === undefined) {\r\n name = \"FunctionModuleTranspilerNameNotFound\";\r\n }\r\n r += `async function ${traversal_1.Traversal.
|
|
15727
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass FunctionModuleTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let r = \"\";\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();\r\n if (name === undefined) {\r\n name = \"FunctionModuleTranspilerNameNotFound\";\r\n }\r\n r += `async function ${traversal_1.Traversal.escapeNamespace(name)}(INPUT) {\\n`;\r\n r += this.findSignature(traversal, name, c);\r\n }\r\n else if (c.get() instanceof abaplint.Statements.EndFunction) {\r\n r += \"}\\n\";\r\n r += `abap.FunctionModules['${name.toUpperCase()}'] = ${traversal_1.Traversal.escapeNamespace(name)};\\n`;\r\n }\r\n else {\r\n r += traversal.traverse(c).getCode();\r\n }\r\n }\r\n unique_identifier_1.UniqueIdentifier.resetIndexBackup();\r\n return new chunk_1.Chunk(r);\r\n }\r\n //////////////////////\r\n findSignature(traversal, name, node) {\r\n var _a;\r\n const group = traversal.getCurrentObject();\r\n if (group === undefined) {\r\n throw \"FunctionModuleTranspilerGroupNotFound\";\r\n }\r\n const module = group.getModule(name);\r\n if (module === undefined) {\r\n throw \"FunctionModuleTranspilerModuleNotFound\";\r\n }\r\n const scope = traversal.findCurrentScopeByToken(node.getLastToken());\r\n let ret = \"\";\r\n for (const p of module.getParameters()) {\r\n ret += `// ${p.direction} ${p.name} ${p.type}\\n`;\r\n let direction = p.direction;\r\n if (direction === \"importing\") {\r\n direction = \"exporting\";\r\n }\r\n else if (direction === \"exporting\") {\r\n direction = \"importing\";\r\n }\r\n // note: all directions are optional\r\n const name = p.name.toLowerCase();\r\n ret += `let ${name} = INPUT.${direction}?.${name};\\n`;\r\n if (direction === \"exporting\" || direction === \"importing\" || direction === \"changing\") {\r\n const type = (_a = scope === null || scope === void 0 ? void 0 : scope.findVariable(name)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type !== undefined) {\r\n // todo, set DEFAULT value\r\n // todo, check for OPTIONALness and raise exceptions and stuff\r\n ret += `if (${name} === undefined) {\n ${name} = ${new transpile_types_1.TranspileTypes().toType(type)};\n }\\n`;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.FunctionModuleTranspiler = FunctionModuleTranspiler;\r\n//# sourceMappingURL=function_module.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/function_module.js?");
|
|
15728
15728
|
|
|
15729
15729
|
/***/ }),
|
|
15730
15730
|
|
|
@@ -15746,7 +15746,7 @@ eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create
|
|
|
15746
15746
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15747
15747
|
|
|
15748
15748
|
"use strict";
|
|
15749
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InterfaceTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass InterfaceTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let ret = \"\";\r\n let name;\r\n const def = traversal.getInterfaceDefinition(node.getFirstToken());\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toLowerCase();\r\n name = traversal_1.Traversal.
|
|
15749
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InterfaceTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass InterfaceTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let ret = \"\";\r\n let name;\r\n const def = traversal.getInterfaceDefinition(node.getFirstToken());\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toLowerCase();\r\n name = traversal_1.Traversal.escapeNamespace(name);\r\n ret += `class ${name} {\\n`;\r\n ret += `static INTERNAL_TYPE = 'INTF';\\n`;\r\n ret += `static IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `\"` + e.name.toUpperCase() + `\"`).join(\",\")}];\\n`;\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {\r\n ret += \"}\\n\";\r\n ret += traversal.registerClassOrInterface(def);\r\n }\r\n }\r\n ret += this.buildConstants(node.findFirstExpression(abaplint.Expressions.InterfaceName), traversal);\r\n ret += this.buildTypes(def);\r\n return new chunk_1.Chunk(ret);\r\n }\r\n buildTypes(idef) {\r\n if (idef === undefined) {\r\n return \"\";\r\n }\r\n const prefix = traversal_1.Traversal.escapeNamespace(idef.getName().toLowerCase()) + \".\";\r\n let ret = \"\";\r\n for (const ty of idef.getTypeDefinitions().getAll()) {\r\n ret += new transpile_types_1.TranspileTypes().declareStaticSkipVoid(prefix, ty.type);\r\n }\r\n return ret;\r\n }\r\n buildConstants(node, traversal) {\r\n if (node === undefined) {\r\n return \"\";\r\n }\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const vars = scope === null || scope === void 0 ? void 0 : scope.getData().vars;\r\n if (vars === undefined || Object.keys(vars).length === 0) {\r\n return \"\";\r\n }\r\n let ret = \"\\n\";\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n if (identifier.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === false\r\n || identifier.getMeta().includes(\"read_only\" /* abaplint.IdentifierMeta.ReadOnly */) === false) {\r\n continue;\r\n }\r\n const interfaceName = traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase());\r\n const name = interfaceName + \".\" + interfaceName + \"$\" + n.toLowerCase();\r\n ret += name + \" = \" + new transpile_types_1.TranspileTypes().toType(identifier.getType()) + \";\\n\";\r\n const constantStatement = traversal.findStatementInFile(identifier.getStart());\r\n const valExpression = constantStatement === null || constantStatement === void 0 ? void 0 : constantStatement.findFirstExpression(abaplint.Expressions.Value);\r\n if ((valExpression === null || valExpression === void 0 ? void 0 : valExpression.getChildren()[1].get()) instanceof abaplint.Expressions.SimpleFieldChain) {\r\n const s = new expressions_1.FieldChainTranspiler().transpile(valExpression.getChildren()[1], traversal, false).getCode();\r\n const e = new expressions_1.ConstantTranspiler().escape(s);\r\n ret += name + \".set(\" + e + \");\\n\";\r\n continue;\r\n }\r\n ret += traversal.setValues(identifier, name);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.InterfaceTranspiler = InterfaceTranspiler;\r\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/interface.js?");
|
|
15750
15750
|
|
|
15751
15751
|
/***/ }),
|
|
15752
15752
|
|
|
@@ -15823,7 +15823,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15823
15823
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15824
15824
|
|
|
15825
15825
|
"use strict";
|
|
15826
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Traversal = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst StatementTranspilers = __webpack_require__(/*! ./statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst ExpressionTranspilers = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst StructureTranspilers = __webpack_require__(/*! ./structures */ \"./node_modules/@abaplint/transpiler/build/src/structures/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst expressions_1 = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass Traversal {\r\n constructor(spaghetti, file, obj, reg, runtimeTypeError = false) {\r\n this.scopeCache = undefined;\r\n this.spaghetti = spaghetti;\r\n this.file = file;\r\n this.obj = obj;\r\n this.reg = reg;\r\n this.runtimeTypeError = runtimeTypeError;\r\n }\r\n static escapeClassName(name) {\r\n return name === null || name === void 0 ? void 0 : name.replace(/\\//g, \"$\");\r\n }\r\n getCurrentObject() {\r\n return this.obj;\r\n }\r\n traverse(node) {\r\n if (node instanceof abaplint.Nodes.StructureNode) {\r\n return this.traverseStructure(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.StatementNode) {\r\n return this.traverseStatement(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.ExpressionNode) {\r\n return this.traverseExpression(node);\r\n }\r\n else if (node === undefined) {\r\n throw new Error(\"Traverse, node undefined\");\r\n }\r\n else {\r\n throw new Error(\"Traverse, unexpected node type\");\r\n }\r\n }\r\n getFilename() {\r\n return this.file.getFilename();\r\n }\r\n getFile() {\r\n return this.file;\r\n }\r\n getSpaghetti() {\r\n return this.spaghetti;\r\n }\r\n /** finds a statement in the _current_ file given a position */\r\n findStatementInFile(pos) {\r\n for (const s of this.file.getStatements()) {\r\n if (pos.isBetween(s.getStart(), s.getEnd())) {\r\n return s;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findCurrentScopeByToken(token) {\r\n const filename = this.file.getFilename();\r\n if (this.scopeCache\r\n && this.scopeCache.filename === filename\r\n && token.getEnd().isBetween(this.scopeCache.cov.start, this.scopeCache.cov.end)) {\r\n return this.scopeCache.node;\r\n }\r\n const node = this.spaghetti.lookupPosition(token.getStart(), filename);\r\n // note: cache only works for leafs, as parent nodes cover multiple leaves\r\n if (node && node.getChildren().length === 0) {\r\n this.scopeCache = {\r\n cov: node.calcCoverage(),\r\n filename: filename,\r\n node: node,\r\n };\r\n }\r\n else {\r\n this.scopeCache = undefined;\r\n }\r\n return node;\r\n }\r\n getInterfaceDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.Interface) {\r\n return scope.findInterfaceDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n getClassDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.ClassImplementation\r\n || scope.getIdentifier().stype === abaplint.ScopeType.ClassDefinition) {\r\n return scope.findClassDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n isClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isClassAttribute, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n if (name.toLowerCase() === \"me\") {\r\n return true;\r\n }\r\n const found = scope.findScopeForVariable(name);\r\n if (found && (found.stype === abaplint.ScopeType.MethodInstance\r\n || found.stype === abaplint.ScopeType.ClassImplementation)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n prefixAndName(t, filename) {\r\n let name = t.getStr().toLowerCase();\r\n if (filename && this.getCurrentObject().getABAPFileByName(filename) === undefined) {\r\n // the prefix is from a different object\r\n const file = this.reg.getFileByName(filename);\r\n if (file) {\r\n const found = this.reg.findObjectForFile(file);\r\n if (found) {\r\n if (found instanceof abaplint.Objects.Interface) {\r\n return Traversal.escapeClassName(this.lookupClassOrInterface(found.getName(), t)) + \".\" + found.getName().toLowerCase() + \"$\" + name;\r\n }\r\n else {\r\n return Traversal.escapeClassName(this.lookupClassOrInterface(found.getName(), t)) + \".\" + name;\r\n }\r\n }\r\n }\r\n }\r\n const className = this.isStaticClassAttribute(t);\r\n if (className) {\r\n name = Traversal.escapeClassName(className) + \".\" + name;\r\n }\r\n else if (name === \"super\") {\r\n return name;\r\n }\r\n else if (this.isClassAttribute(t)) {\r\n name = \"this.\" + Traversal.escapeClassName(name);\r\n }\r\n else if (this.isBuiltinVariable(t)) {\r\n name = \"abap.builtin.\" + name;\r\n }\r\n return name;\r\n }\r\n isStaticClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(`isStaticClassAttribute, unable to lookup position, ${token.getStr()},${token.getRow()},${token.getCol()},` +\r\n this.file.getFilename());\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n const id = scope.findVariable(name);\r\n if (found && id\r\n && id.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */)\r\n && found.stype === abaplint.ScopeType.ClassImplementation) {\r\n // console.dir(found.sname);\r\n return found.sname.toLowerCase();\r\n }\r\n return undefined;\r\n }\r\n isBuiltinMethod(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return false;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n findMethodReference(token, scope) {\r\n var _a, _b;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodReference\r\n && r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n let name = r.resolved.getName();\r\n if (((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooType) === \"INTF\") {\r\n name = r.extra.ooName + \"$\" + name;\r\n }\r\n return { def: r.resolved, name };\r\n }\r\n else if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n const def = r.resolved;\r\n const name = def.getName();\r\n return { def, name };\r\n }\r\n }\r\n return undefined;\r\n }\r\n isBuiltinVariable(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isBuiltin, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n if (found && found.stype === abaplint.ScopeType.BuiltIn) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // returns the interface name if interfaced\r\n isInterfaceAttribute(token) {\r\n const ref = this.findReadOrWriteReference(token);\r\n if (ref === undefined) {\r\n return undefined;\r\n }\r\n // local classes\r\n if (ref.getFilename() === this.getFilename()) {\r\n const scope = this.findCurrentScopeByToken(ref.getToken());\r\n if ((scope === null || scope === void 0 ? void 0 : scope.getIdentifier().stype) === abaplint.ScopeType.Interface) {\r\n return scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname;\r\n }\r\n }\r\n // global classes\r\n const file = this.reg.getFileByName(ref.getFilename());\r\n if (file) {\r\n const obj = this.reg.findObjectForFile(file);\r\n if ((obj === null || obj === void 0 ? void 0 : obj.getType()) === \"INTF\") {\r\n return obj.getName().toLowerCase();\r\n }\r\n }\r\n return undefined;\r\n }\r\n findReadOrWriteReference(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if ((r.referenceType === abaplint.ReferenceType.DataReadReference\r\n || r.referenceType === abaplint.ReferenceType.DataWriteReference)\r\n && r.position.getStart().equals(token.getStart())) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n buildConstructorContents(scope, def) {\r\n let ret = \"\";\r\n if (def.getSuperClass() !== undefined\r\n && def.getMethodDefinitions().getByName(\"CONSTRUCTOR\") === undefined) {\r\n ret += `await super.constructor_(INPUT);\\n`;\r\n }\r\n const cName = Traversal.escapeClassName(def.getName().toLowerCase());\r\n ret += \"this.me = new abap.types.ABAPObject();\\n\";\r\n ret += \"this.me.set(this);\\n\";\r\n for (const a of def.getAttributes().getAll()) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const name = \"this.\" + a.getName().toLowerCase();\r\n ret += name + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n ret += this.setValues(a, name);\r\n }\r\n // attributes from directly implemented interfaces(not interfaces implemented in super classes)\r\n for (const i of def.getImplementing()) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n // handle aliases after initialization of carrier variables\r\n for (const a of def.getAliases().getAll()) {\r\n ret += \"this.\" + a.getName().toLowerCase() + \" = this.\" + Traversal.escapeClassName(a.getComponent().replace(\"~\", \"$\").toLowerCase()) + \";\\n\";\r\n }\r\n // constants can be accessed both statically and via reference\r\n for (const c of def.getAttributes().getConstants()) {\r\n ret += \"this.\" + c.getName().toLowerCase() + \" = \" + cName + \".\" + c.getName().toLowerCase() + \";\\n\";\r\n }\r\n return ret;\r\n }\r\n findInterfaceDefinition(name, scope) {\r\n let intf = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n if (intf === undefined) {\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n intf = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return intf;\r\n }\r\n findTable(name) {\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n return tabl;\r\n }\r\n findClassDefinition(name, scope) {\r\n if (name === undefined || scope === undefined) {\r\n return undefined;\r\n }\r\n let clas = scope.findClassDefinition(name);\r\n if (clas === undefined) {\r\n const iglobal = this.reg.getObject(\"CLAS\", name);\r\n clas = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return clas;\r\n }\r\n dataFromInterfaces(name, scope) {\r\n let ret = \"\";\r\n const intf = this.findInterfaceDefinition(name, scope);\r\n for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const n = Traversal.escapeClassName(name.toLowerCase()) + \"$\" + a.getName().toLowerCase();\r\n ret += \"this.\" + n + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n }\r\n for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n return ret;\r\n }\r\n determineType(node, scope) {\r\n var _a, _b, _c;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n const found = node.findDirectExpression(abaplint.Expressions.Target);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n let context = undefined;\r\n for (const c of found.getChildren()) {\r\n if (context === undefined) {\r\n context = (_a = scope.findVariable(c.getFirstToken().getStr())) === null || _a === void 0 ? void 0 : _a.getType();\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.ComponentName\r\n && context instanceof abaplint.BasicTypes.StructureType) {\r\n context = context.getComponentByName(c.getFirstToken().getStr());\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.AttributeName\r\n && context instanceof abaplint.BasicTypes.ObjectReferenceType) {\r\n const id = context.getIdentifier();\r\n if (id instanceof abaplint.Types.ClassDefinition || id instanceof abaplint.Types.InterfaceDefinition) {\r\n const concat = c.concatTokens();\r\n if (concat.includes(\"~\")) {\r\n const [iname, aname] = concat.split(\"~\");\r\n const intf = this.findInterfaceDefinition(iname, scope);\r\n context = (_b = intf === null || intf === void 0 ? void 0 : intf.getAttributes().findByName(aname)) === null || _b === void 0 ? void 0 : _b.getType();\r\n }\r\n else {\r\n context = (_c = id.getAttributes().findByName(concat)) === null || _c === void 0 ? void 0 : _c.getType();\r\n }\r\n }\r\n }\r\n }\r\n return context;\r\n }\r\n isInsideLoop(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.Loop\r\n || get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.SelectLoop\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndLoop\r\n || get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndSelect\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n isInsideDoOrWhile(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n registerClassOrInterface(def) {\r\n if (def === undefined) {\r\n return \"\";\r\n }\r\n const name = def.getName();\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeClassName(name.toLowerCase())};`;\r\n }\r\n else {\r\n return `abap.Classes['${name.toUpperCase()}'] = ${Traversal.escapeClassName(name.toLowerCase())};`;\r\n }\r\n }\r\n setValues(identifier, name) {\r\n const val = identifier.getValue();\r\n let ret = \"\";\r\n if (typeof val === \"string\") {\r\n const e = new expressions_1.ConstantTranspiler().escape(val);\r\n ret += name + \".set(\" + e + \");\\n\";\r\n }\r\n else if (typeof val === \"object\") {\r\n const a = val;\r\n for (const v of Object.keys(val)) {\r\n let s = a[v];\r\n if (s === undefined) {\r\n continue;\r\n }\r\n s = new expressions_1.ConstantTranspiler().escape(s);\r\n ret += name + \".get().\" + v + \".set(\" + s + \");\\n\";\r\n }\r\n }\r\n return ret;\r\n }\r\n lookupClassOrInterface(name, token, directGlobal = false) {\r\n var _a, _b;\r\n if (name === undefined || token === undefined) {\r\n return \"abap.Classes['undefined']\";\r\n }\r\n if (directGlobal === true) {\r\n return \"abap.Classes[\" + name + \"]\";\r\n }\r\n const scope = this.findCurrentScopeByToken(token);\r\n // todo, add explicit type,\r\n let def = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);\r\n if (def === undefined) {\r\n def = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n }\r\n if (def) {\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;\r\n }\r\n else {\r\n return `abap.Classes['${(_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()}']`;\r\n }\r\n }\r\n else {\r\n // assume global\r\n return \"abap.Classes['\" + name.toUpperCase() + \"']\";\r\n }\r\n }\r\n buildPrefix(def) {\r\n const file = this.reg.getFileByName(def.getFilename());\r\n if (file === undefined) {\r\n return \"NOT_FOUND\";\r\n }\r\n const obj = this.reg.findObjectForFile(file);\r\n return (obj === null || obj === void 0 ? void 0 : obj.getType()) + \"-\" + (obj === null || obj === void 0 ? void 0 : obj.getName());\r\n }\r\n ////////////////////////////\r\n traverseStructure(node) {\r\n const list = StructureTranspilers;\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StructureNode) {\r\n const search = c.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n ret.appendChunk(transpiler.transpile(c, this));\r\n continue;\r\n }\r\n ret.appendChunk(this.traverseStructure(c));\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode) {\r\n ret.appendChunk(this.traverseStatement(c));\r\n }\r\n else {\r\n throw new Error(\"traverseStructure, unexpected child node type\");\r\n }\r\n }\r\n return ret;\r\n }\r\n traverseStatement(node) {\r\n const list = StatementTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n const chunk = transpiler.transpile(node, this);\r\n chunk.appendString(\"\\n\");\r\n return chunk;\r\n }\r\n throw new Error(`Statement ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n traverseExpression(node) {\r\n const list = ExpressionTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n return transpiler.transpile(node, this);\r\n }\r\n throw new Error(`Expression ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n}\r\nexports.Traversal = Traversal;\r\n//# sourceMappingURL=traversal.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/traversal.js?");
|
|
15826
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Traversal = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst StatementTranspilers = __webpack_require__(/*! ./statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst ExpressionTranspilers = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst StructureTranspilers = __webpack_require__(/*! ./structures */ \"./node_modules/@abaplint/transpiler/build/src/structures/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst expressions_1 = __webpack_require__(/*! ./expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass Traversal {\r\n constructor(spaghetti, file, obj, reg, runtimeTypeError = false) {\r\n this.scopeCache = undefined;\r\n this.spaghetti = spaghetti;\r\n this.file = file;\r\n this.obj = obj;\r\n this.reg = reg;\r\n this.runtimeTypeError = runtimeTypeError;\r\n }\r\n static escapeNamespace(name) {\r\n return name === null || name === void 0 ? void 0 : name.replace(/\\//g, \"$\");\r\n }\r\n getCurrentObject() {\r\n return this.obj;\r\n }\r\n traverse(node) {\r\n if (node instanceof abaplint.Nodes.StructureNode) {\r\n return this.traverseStructure(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.StatementNode) {\r\n return this.traverseStatement(node);\r\n }\r\n else if (node instanceof abaplint.Nodes.ExpressionNode) {\r\n return this.traverseExpression(node);\r\n }\r\n else if (node === undefined) {\r\n throw new Error(\"Traverse, node undefined\");\r\n }\r\n else {\r\n throw new Error(\"Traverse, unexpected node type\");\r\n }\r\n }\r\n getFilename() {\r\n return this.file.getFilename();\r\n }\r\n getFile() {\r\n return this.file;\r\n }\r\n getSpaghetti() {\r\n return this.spaghetti;\r\n }\r\n /** finds a statement in the _current_ file given a position */\r\n findStatementInFile(pos) {\r\n for (const s of this.file.getStatements()) {\r\n if (pos.isBetween(s.getStart(), s.getEnd())) {\r\n return s;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findCurrentScopeByToken(token) {\r\n const filename = this.file.getFilename();\r\n if (this.scopeCache\r\n && this.scopeCache.filename === filename\r\n && token.getEnd().isBetween(this.scopeCache.cov.start, this.scopeCache.cov.end)) {\r\n return this.scopeCache.node;\r\n }\r\n const node = this.spaghetti.lookupPosition(token.getStart(), filename);\r\n // note: cache only works for leafs, as parent nodes cover multiple leaves\r\n if (node && node.getChildren().length === 0) {\r\n this.scopeCache = {\r\n cov: node.calcCoverage(),\r\n filename: filename,\r\n node: node,\r\n };\r\n }\r\n else {\r\n this.scopeCache = undefined;\r\n }\r\n return node;\r\n }\r\n getInterfaceDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.Interface) {\r\n return scope.findInterfaceDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n getClassDefinition(token) {\r\n let scope = this.findCurrentScopeByToken(token);\r\n while (scope !== undefined) {\r\n if (scope.getIdentifier().stype === abaplint.ScopeType.ClassImplementation\r\n || scope.getIdentifier().stype === abaplint.ScopeType.ClassDefinition) {\r\n return scope.findClassDefinition(scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname);\r\n }\r\n scope = scope.getParent();\r\n }\r\n return undefined;\r\n }\r\n isClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isClassAttribute, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n if (name.toLowerCase() === \"me\") {\r\n return true;\r\n }\r\n const found = scope.findScopeForVariable(name);\r\n if (found && (found.stype === abaplint.ScopeType.MethodInstance\r\n || found.stype === abaplint.ScopeType.ClassImplementation)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n prefixAndName(t, filename) {\r\n let name = t.getStr().toLowerCase();\r\n if (filename && this.getCurrentObject().getABAPFileByName(filename) === undefined) {\r\n // the prefix is from a different object\r\n const file = this.reg.getFileByName(filename);\r\n if (file) {\r\n const found = this.reg.findObjectForFile(file);\r\n if (found) {\r\n if (found instanceof abaplint.Objects.Interface) {\r\n return Traversal.escapeNamespace(this.lookupClassOrInterface(found.getName(), t)) + \".\" + found.getName().toLowerCase() + \"$\" + name;\r\n }\r\n else {\r\n return Traversal.escapeNamespace(this.lookupClassOrInterface(found.getName(), t)) + \".\" + name;\r\n }\r\n }\r\n }\r\n }\r\n const className = this.isStaticClassAttribute(t);\r\n if (className) {\r\n name = Traversal.escapeNamespace(className) + \".\" + name;\r\n }\r\n else if (name === \"super\") {\r\n return name;\r\n }\r\n else if (this.isClassAttribute(t)) {\r\n name = \"this.\" + Traversal.escapeNamespace(name);\r\n }\r\n else if (this.isBuiltinVariable(t)) {\r\n name = \"abap.builtin.\" + name;\r\n }\r\n return name;\r\n }\r\n isStaticClassAttribute(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(`isStaticClassAttribute, unable to lookup position, ${token.getStr()},${token.getRow()},${token.getCol()},` +\r\n this.file.getFilename());\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n const id = scope.findVariable(name);\r\n if (found && id\r\n && id.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */)\r\n && found.stype === abaplint.ScopeType.ClassImplementation) {\r\n // console.dir(found.sname);\r\n return found.sname.toLowerCase();\r\n }\r\n return undefined;\r\n }\r\n isBuiltinMethod(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return false;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n findMethodReference(token, scope) {\r\n var _a, _b;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodReference\r\n && r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n let name = r.resolved.getName();\r\n if (((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooType) === \"INTF\") {\r\n name = r.extra.ooName + \"$\" + name;\r\n }\r\n return { def: r.resolved, name };\r\n }\r\n else if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference\r\n && r.position.getStart().equals(token.getStart())) {\r\n const def = r.resolved;\r\n const name = def.getName();\r\n return { def, name };\r\n }\r\n }\r\n return undefined;\r\n }\r\n isBuiltinVariable(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"isBuiltin, unable to lookup position\");\r\n }\r\n const name = token.getStr();\r\n const found = scope.findScopeForVariable(name);\r\n if (found && found.stype === abaplint.ScopeType.BuiltIn) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // returns the interface name if interfaced\r\n isInterfaceAttribute(token) {\r\n const ref = this.findReadOrWriteReference(token);\r\n if (ref === undefined) {\r\n return undefined;\r\n }\r\n // local classes\r\n if (ref.getFilename() === this.getFilename()) {\r\n const scope = this.findCurrentScopeByToken(ref.getToken());\r\n if ((scope === null || scope === void 0 ? void 0 : scope.getIdentifier().stype) === abaplint.ScopeType.Interface) {\r\n return scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname;\r\n }\r\n }\r\n // global classes\r\n const file = this.reg.getFileByName(ref.getFilename());\r\n if (file) {\r\n const obj = this.reg.findObjectForFile(file);\r\n if ((obj === null || obj === void 0 ? void 0 : obj.getType()) === \"INTF\") {\r\n return obj.getName().toLowerCase();\r\n }\r\n }\r\n return undefined;\r\n }\r\n findReadOrWriteReference(token) {\r\n const scope = this.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if ((r.referenceType === abaplint.ReferenceType.DataReadReference\r\n || r.referenceType === abaplint.ReferenceType.DataWriteReference)\r\n && r.position.getStart().equals(token.getStart())) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n buildConstructorContents(scope, def) {\r\n let ret = \"\";\r\n if (def.getSuperClass() !== undefined\r\n && def.getMethodDefinitions().getByName(\"CONSTRUCTOR\") === undefined) {\r\n ret += `await super.constructor_(INPUT);\\n`;\r\n }\r\n const cName = Traversal.escapeNamespace(def.getName().toLowerCase());\r\n ret += \"this.me = new abap.types.ABAPObject();\\n\";\r\n ret += \"this.me.set(this);\\n\";\r\n for (const a of def.getAttributes().getAll()) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const name = \"this.\" + Traversal.escapeNamespace(a.getName().toLowerCase());\r\n ret += name + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n ret += this.setValues(a, name);\r\n }\r\n // attributes from directly implemented interfaces(not interfaces implemented in super classes)\r\n for (const i of def.getImplementing()) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n // handle aliases after initialization of carrier variables\r\n for (const a of def.getAliases().getAll()) {\r\n ret += \"this.\" + a.getName().toLowerCase() + \" = this.\" + Traversal.escapeNamespace(a.getComponent().replace(\"~\", \"$\").toLowerCase()) + \";\\n\";\r\n }\r\n // constants can be accessed both statically and via reference\r\n for (const c of def.getAttributes().getConstants()) {\r\n ret += \"this.\" + Traversal.escapeNamespace(c.getName().toLowerCase()) + \" = \" + cName + \".\" + Traversal.escapeNamespace(c.getName().toLowerCase()) + \";\\n\";\r\n }\r\n return ret;\r\n }\r\n findInterfaceDefinition(name, scope) {\r\n let intf = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n if (intf === undefined) {\r\n const iglobal = this.reg.getObject(\"INTF\", name);\r\n intf = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return intf;\r\n }\r\n findTable(name) {\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n return tabl;\r\n }\r\n findClassDefinition(name, scope) {\r\n if (name === undefined || scope === undefined) {\r\n return undefined;\r\n }\r\n let clas = scope.findClassDefinition(name);\r\n if (clas === undefined) {\r\n const iglobal = this.reg.getObject(\"CLAS\", name);\r\n clas = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();\r\n }\r\n return clas;\r\n }\r\n dataFromInterfaces(name, scope) {\r\n let ret = \"\";\r\n const intf = this.findInterfaceDefinition(name, scope);\r\n for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {\r\n if (a.getMeta().includes(\"static\" /* abaplint.IdentifierMeta.Static */) === true) {\r\n continue;\r\n }\r\n const n = Traversal.escapeNamespace(name.toLowerCase()) + \"$\" + a.getName().toLowerCase();\r\n ret += \"this.\" + n + \" = \" + new transpile_types_1.TranspileTypes().toType(a.getType()) + \";\\n\";\r\n }\r\n for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {\r\n ret += this.dataFromInterfaces(i.name, scope);\r\n }\r\n return ret;\r\n }\r\n determineType(node, scope) {\r\n var _a, _b, _c;\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n const found = node.findDirectExpression(abaplint.Expressions.Target);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n let context = undefined;\r\n for (const c of found.getChildren()) {\r\n if (context === undefined) {\r\n context = (_a = scope.findVariable(c.getFirstToken().getStr())) === null || _a === void 0 ? void 0 : _a.getType();\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.ComponentName\r\n && context instanceof abaplint.BasicTypes.StructureType) {\r\n context = context.getComponentByName(c.getFirstToken().getStr());\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.AttributeName\r\n && context instanceof abaplint.BasicTypes.ObjectReferenceType) {\r\n const id = context.getIdentifier();\r\n if (id instanceof abaplint.Types.ClassDefinition || id instanceof abaplint.Types.InterfaceDefinition) {\r\n const concat = c.concatTokens();\r\n if (concat.includes(\"~\")) {\r\n const [iname, aname] = concat.split(\"~\");\r\n const intf = this.findInterfaceDefinition(iname, scope);\r\n context = (_b = intf === null || intf === void 0 ? void 0 : intf.getAttributes().findByName(aname)) === null || _b === void 0 ? void 0 : _b.getType();\r\n }\r\n else {\r\n context = (_c = id.getAttributes().findByName(concat)) === null || _c === void 0 ? void 0 : _c.getType();\r\n }\r\n }\r\n }\r\n }\r\n return context;\r\n }\r\n isInsideLoop(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.Loop\r\n || get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.SelectLoop\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndLoop\r\n || get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndSelect\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n isInsideDoOrWhile(node) {\r\n const stack = [];\r\n for (const statement of this.getFile().getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof abaplint.Statements.While\r\n || get instanceof abaplint.Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof abaplint.Statements.EndWhile\r\n || get instanceof abaplint.Statements.EndDo) {\r\n stack.pop();\r\n }\r\n if (statement === node) {\r\n break;\r\n }\r\n }\r\n return stack.length > 0;\r\n }\r\n registerClassOrInterface(def) {\r\n if (def === undefined) {\r\n return \"\";\r\n }\r\n const name = def.getName();\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeNamespace(name.toLowerCase())};`;\r\n }\r\n else {\r\n return `abap.Classes['${name.toUpperCase()}'] = ${Traversal.escapeNamespace(name.toLowerCase())};`;\r\n }\r\n }\r\n setValues(identifier, name) {\r\n const val = identifier.getValue();\r\n let ret = \"\";\r\n if (typeof val === \"string\") {\r\n const e = new expressions_1.ConstantTranspiler().escape(val);\r\n ret += name + \".set(\" + e + \");\\n\";\r\n }\r\n else if (typeof val === \"object\") {\r\n const a = val;\r\n for (const v of Object.keys(val)) {\r\n let s = a[v];\r\n if (s === undefined) {\r\n continue;\r\n }\r\n s = new expressions_1.ConstantTranspiler().escape(s);\r\n ret += name + \".get().\" + v + \".set(\" + s + \");\\n\";\r\n }\r\n }\r\n return ret;\r\n }\r\n lookupClassOrInterface(name, token, directGlobal = false) {\r\n var _a, _b;\r\n if (name === undefined || token === undefined) {\r\n return \"abap.Classes['undefined']\";\r\n }\r\n if (directGlobal === true) {\r\n return \"abap.Classes[\" + name + \"]\";\r\n }\r\n const scope = this.findCurrentScopeByToken(token);\r\n // todo, add explicit type,\r\n let def = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(name);\r\n if (def === undefined) {\r\n def = scope === null || scope === void 0 ? void 0 : scope.findInterfaceDefinition(name);\r\n }\r\n if (def) {\r\n if (def.isGlobal() === false) {\r\n const prefix = this.buildPrefix(def);\r\n return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;\r\n }\r\n else {\r\n return `abap.Classes['${(_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase()}']`;\r\n }\r\n }\r\n else {\r\n // assume global\r\n return \"abap.Classes['\" + name.toUpperCase() + \"']\";\r\n }\r\n }\r\n buildPrefix(def) {\r\n const file = this.reg.getFileByName(def.getFilename());\r\n if (file === undefined) {\r\n return \"NOT_FOUND\";\r\n }\r\n const obj = this.reg.findObjectForFile(file);\r\n return (obj === null || obj === void 0 ? void 0 : obj.getType()) + \"-\" + (obj === null || obj === void 0 ? void 0 : obj.getName());\r\n }\r\n ////////////////////////////\r\n traverseStructure(node) {\r\n const list = StructureTranspilers;\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StructureNode) {\r\n const search = c.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n ret.appendChunk(transpiler.transpile(c, this));\r\n continue;\r\n }\r\n ret.appendChunk(this.traverseStructure(c));\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode) {\r\n ret.appendChunk(this.traverseStatement(c));\r\n }\r\n else {\r\n throw new Error(\"traverseStructure, unexpected child node type\");\r\n }\r\n }\r\n return ret;\r\n }\r\n traverseStatement(node) {\r\n const list = StatementTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n const chunk = transpiler.transpile(node, this);\r\n chunk.appendString(\"\\n\");\r\n return chunk;\r\n }\r\n throw new Error(`Statement ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n traverseExpression(node) {\r\n const list = ExpressionTranspilers;\r\n const search = node.get().constructor.name + \"Transpiler\";\r\n if (list[search]) {\r\n const transpiler = new list[search]();\r\n return transpiler.transpile(node, this);\r\n }\r\n throw new Error(`Expression ${node.get().constructor.name} not supported, ${node.concatTokens()}`);\r\n }\r\n}\r\nexports.Traversal = Traversal;\r\n//# sourceMappingURL=traversal.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/traversal.js?");
|
|
15827
15827
|
|
|
15828
15828
|
/***/ }),
|
|
15829
15829
|
|
|
@@ -15845,7 +15845,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15845
15845
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15846
15846
|
|
|
15847
15847
|
"use strict";
|
|
15848
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnitTest = void 0;\r\n/* eslint-disable max-len */\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass UnitTest {\r\n // todo, move this method somewhere else, its much more than just unit test relevant\r\n initializationScript(reg, dbSetup, extraSetup, useImport) {\r\n let ret = \"\";\r\n if (useImport === true) {\r\n ret = `/* eslint-disable import/newline-after-import */\r\nimport \"./_top.mjs\";\\n`;\r\n }\r\n else {\r\n ret = `/* eslint-disable import/newline-after-import */\r\nimport runtime from \"@abaplint/runtime\";\r\nglobalThis.abap = new runtime.ABAP();\\n`;\r\n }\r\n ret += `${this.buildImports(reg, useImport)}\r\n\r\nexport async function initializeABAP() {\\n`;\r\n ret += ` const sqlite = [];\\n`;\r\n for (const i of dbSetup.schemas.sqlite) {\r\n ret += `sqlite.push(\\`${i}\\`);\\n`;\r\n }\r\n ret += ` const hdb = \\`${dbSetup.schemas.hdb}\\`;\\n`;\r\n ret += ` const pg = \\`${dbSetup.schemas.pg}\\`;\\n`;\r\n ret += ` const schemas = {sqlite, hdb, pg};\\n`;\r\n ret += ` const insert = [];\\n`;\r\n for (const i of dbSetup.insert) {\r\n ret += ` insert.push(\\`${i}\\`);\\n`;\r\n }\r\n if (extraSetup === undefined) {\r\n ret += `// no setup logic specified in config\\n`;\r\n }\r\n else {\r\n ret += ` const {setup} = await import(\"${extraSetup}\");\\n` +\r\n ` await setup(globalThis.abap, schemas, insert);\\n`;\r\n }\r\n ret += `}`;\r\n return ret;\r\n }\r\n escapeNamespace(filename) {\r\n // ES modules are resolved and cached as URLs. This means that special characters must be percent-encoded, such as # with %23 and ? with %3F.\r\n return filename.replace(/\\//g, \"%23\");\r\n }\r\n unitTestScriptOpen(reg, _skip, _only) {\r\n let ret = `/* eslint-disable curly */\r\nimport fs from \"fs\";\r\nimport path from \"path\";\r\nimport {fileURLToPath} from \"url\";\r\nimport {initializeABAP} from \"./init.mjs\";\r\n\r\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\r\n\r\nasync function run() {\r\n await initializeABAP();\r\n let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)}), {\"withHeader\":false,\"type\":\"STANDARD\",\"isUnique\":false,\"keyFields\":[]});\r\n let ls_input = new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)});\r\n let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String(), console: new abap.types.String()}), {\"withHeader\":false,\"type\":\"STANDARD\",\"isUnique\":false,\"keyFields\":[]}), json: new abap.types.String()});\r\n`;\r\n for (const obj of reg.getObjects()) {\r\n if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {\r\n continue;\r\n }\r\n const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(\".testclasses.\"); });\r\n if (hasTestFile === true) {\r\n ret += ` await import(\"./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs\");\\n`;\r\n }\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {\r\n // todo, fix, there might be global test methods\r\n continue;\r\n }\r\n for (const m of def.methods) {\r\n if (m.isForTesting === false) {\r\n continue;\r\n }\r\n ret += ` ls_input.get().class_name.set(\"${obj.getName()}\");\r\n ls_input.get().testclass_name.set(\"${def.name.toUpperCase()}\");\r\n ls_input.get().method_name.set(\"${m.name.toUpperCase()}\");\r\n abap.statements.append({source: ls_input, target: lt_input});\\n`;\r\n }\r\n }\r\n }\r\n }\r\n ret += `\r\n\r\n ls_result.set(await abap.Classes[\"KERNEL_UNIT_RUNNER\"].run({it_input: lt_input}));\r\n fs.writeFileSync(__dirname + path.sep + \"output.json\", ls_result.get().json.get());\r\n}\r\n\r\nrun().then(() => {\r\n process.exit(0);\r\n}).catch((err) => {\r\n console.log(err);\r\n process.exit(1);\r\n});`;\r\n return ret;\r\n }\r\n unitTestScript(reg, skip, _only) {\r\n let ret = `/* eslint-disable curly */\r\nimport fs from \"fs\";\r\nimport path from \"path\";\r\nimport {fileURLToPath} from \"url\";\r\nimport {initializeABAP} from \"./init.mjs\";\r\nimport runtime from \"@abaplint/runtime\";\r\n\r\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\r\n\r\nasync function run() {\r\n await initializeABAP();\r\n const unit = new runtime.UnitTestResult();\r\n let clas;\r\n let locl;\r\n let meth;\r\n try {\\n`;\r\n for (const obj of reg.getObjects()) {\r\n if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {\r\n continue;\r\n }\r\n ret += `// --------------------------------------------\\n`;\r\n ret += ` clas = unit.addObject(\"${obj.getName()}\");\\n`;\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {\r\n // todo, fix, there might be global test methods\r\n continue;\r\n }\r\n ret += ` {\r\n const {${def.name}} = await import(\"./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs\");\r\n locl = clas.addTestClass(\"${def.name}\");\r\n if (${def.name}.class_setup) await ${def.name}.class_setup();\\n`;\r\n for (const m of def.methods) {\r\n if (m.isForTesting === false) {\r\n continue;\r\n }\r\n const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);\r\n if (skipThis) {\r\n ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\\n`;\r\n ret += ` meth = locl.addMethod(\"${m.name}\");\\n`;\r\n ret += ` meth.skip();\\n`;\r\n continue;\r\n }\r\n ret += ` {\\n const test = await (new ${def.name}()).constructor_();\\n`;\r\n ret += ` if (test.setup) await test.setup();\\n`;\r\n ret += ` console.log(\"${obj.getName()}: running ${def.name}->${m.name}\");\\n`;\r\n ret += ` meth = locl.addMethod(\"${m.name}\");\\n`;\r\n ret += ` await test.${m.name}();\\n`;\r\n ret += ` meth.pass();\\n`;\r\n ret += ` if (test.teardown) await test.teardown();\\n`;\r\n ret += ` }\\n`;\r\n }\r\n ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\\n`;\r\n ret += ` }\\n`;\r\n }\r\n }\r\n }\r\n ret += `// -------------------END-------------------\r\n console.log(abap.console.get());\r\n fs.writeFileSync(__dirname + path.sep + \"_output.xml\", unit.xUnitXML());\r\n } catch (e) {\r\n if (meth) {\r\n meth.fail();\r\n }\r\n console.log(abap.console.get());\r\n fs.writeFileSync(__dirname + path.sep + \"_output.xml\", unit.xUnitXML());\r\n throw e;\r\n }\r\n}\r\n\r\nrun().then(() => {\r\n process.exit(0);\r\n}).catch((err) => {\r\n console.log(err);\r\n process.exit(1);\r\n});`;\r\n return ret;\r\n }\r\n buildImports(reg, useImport) {\r\n // note: ES modules are hoised, so use the dynamic import(), due to setting of globalThis.abap\r\n // some sorting required: eg. a class constructor using constant from interface\r\n const list = [];\r\n const late = [];\r\n const imp = (filename) => {\r\n if (useImport === true) {\r\n return `import \"./${filename}.mjs\";`;\r\n }\r\n else {\r\n return `await import(\"./${filename}.mjs\");`;\r\n }\r\n };\r\n for (const obj of reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table\r\n || obj instanceof abaplint.Objects.DataElement\r\n || obj instanceof abaplint.Objects.LockObject\r\n || obj instanceof abaplint.Objects.TableType) {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n }\r\n for (const obj of reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.FunctionGroup) {\r\n for (const m of obj.getModules()) {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.fugr.${this.escapeNamespace(m.getName().toLowerCase())}`));\r\n }\r\n }\r\n else if (obj instanceof abaplint.Objects.Class) {\r\n if (obj.getName().toUpperCase() !== \"CL_ABAP_CHAR_UTILITIES\"\r\n && this.hasClassConstructor(reg, obj)) {\r\n // this will not solve all problems with class constors 100%, but probably good enough\r\n late.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n else {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n }\r\n else if (obj instanceof abaplint.Objects.Interface) {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n }\r\n return [...list.sort(), ...late].join(\"\\n\");\r\n }\r\n // class constructors might make early use of eg. constants from interfaces\r\n // sub classes will import() super classes and trigger a class constructor of the super\r\n hasClassConstructor(reg, clas) {\r\n var _a, _b;\r\n if (((_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getMethodDefinitions().getByName(\"CLASS_CONSTRUCTOR\")) !== undefined) {\r\n return true;\r\n }\r\n const sup = (_b = clas.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass();\r\n if (sup !== undefined) {\r\n const superClass = reg.getObject(\"CLAS\", sup);\r\n if (superClass) {\r\n return this.hasClassConstructor(reg, superClass);\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UnitTest = UnitTest;\r\n//# sourceMappingURL=unit_test.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/unit_test.js?");
|
|
15848
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnitTest = void 0;\r\n/* eslint-disable max-len */\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass UnitTest {\r\n // todo, move this method somewhere else, its much more than just unit test relevant\r\n initializationScript(reg, dbSetup, extraSetup, useImport) {\r\n let ret = \"\";\r\n if (useImport === true) {\r\n ret = `/* eslint-disable import/newline-after-import */\nimport \"./_top.mjs\";\\n`;\r\n }\r\n else {\r\n ret = `/* eslint-disable import/newline-after-import */\nimport runtime from \"@abaplint/runtime\";\nglobalThis.abap = new runtime.ABAP();\\n`;\r\n }\r\n ret += `${this.buildImports(reg, useImport)}\n\nexport async function initializeABAP() {\\n`;\r\n ret += ` const sqlite = [];\\n`;\r\n for (const i of dbSetup.schemas.sqlite) {\r\n ret += `sqlite.push(\\`${i}\\`);\\n`;\r\n }\r\n ret += ` const hdb = \\`${dbSetup.schemas.hdb}\\`;\\n`;\r\n ret += ` const pg = \\`${dbSetup.schemas.pg}\\`;\\n`;\r\n ret += ` const schemas = {sqlite, hdb, pg};\\n`;\r\n ret += ` const insert = [];\\n`;\r\n for (const i of dbSetup.insert) {\r\n ret += ` insert.push(\\`${i}\\`);\\n`;\r\n }\r\n if (extraSetup === undefined) {\r\n ret += `// no setup logic specified in config\\n`;\r\n }\r\n else {\r\n ret += ` const {setup} = await import(\"${extraSetup}\");\\n` +\r\n ` await setup(globalThis.abap, schemas, insert);\\n`;\r\n }\r\n ret += `}`;\r\n return ret;\r\n }\r\n escapeNamespace(filename) {\r\n // ES modules are resolved and cached as URLs. This means that special characters must be percent-encoded, such as # with %23 and ? with %3F.\r\n return filename.replace(/\\//g, \"%23\");\r\n }\r\n unitTestScriptOpen(reg, _skip, _only) {\r\n let ret = `/* eslint-disable curly */\nimport fs from \"fs\";\nimport path from \"path\";\nimport {fileURLToPath} from \"url\";\nimport {initializeABAP} from \"./init.mjs\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nasync function run() {\n await initializeABAP();\n let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)}), {\"withHeader\":false,\"type\":\"STANDARD\",\"isUnique\":false,\"keyFields\":[]});\n let ls_input = new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)});\n let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String(), console: new abap.types.String()}), {\"withHeader\":false,\"type\":\"STANDARD\",\"isUnique\":false,\"keyFields\":[]}), json: new abap.types.String()});\n`;\r\n for (const obj of reg.getObjects()) {\r\n if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {\r\n continue;\r\n }\r\n const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(\".testclasses.\"); });\r\n if (hasTestFile === true) {\r\n ret += ` await import(\"./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs\");\\n`;\r\n }\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {\r\n // todo, fix, there might be global test methods\r\n continue;\r\n }\r\n for (const m of def.methods) {\r\n if (m.isForTesting === false) {\r\n continue;\r\n }\r\n ret += ` ls_input.get().class_name.set(\"${obj.getName()}\");\n ls_input.get().testclass_name.set(\"${def.name.toUpperCase()}\");\n ls_input.get().method_name.set(\"${m.name.toUpperCase()}\");\n abap.statements.append({source: ls_input, target: lt_input});\\n`;\r\n }\r\n }\r\n }\r\n }\r\n ret += `\n\n ls_result.set(await abap.Classes[\"KERNEL_UNIT_RUNNER\"].run({it_input: lt_input}));\n fs.writeFileSync(__dirname + path.sep + \"output.json\", ls_result.get().json.get());\n}\n\nrun().then(() => {\n process.exit(0);\n}).catch((err) => {\n console.log(err);\n process.exit(1);\n});`;\r\n return ret;\r\n }\r\n unitTestScript(reg, skip, _only) {\r\n let ret = `/* eslint-disable curly */\nimport fs from \"fs\";\nimport path from \"path\";\nimport {fileURLToPath} from \"url\";\nimport {initializeABAP} from \"./init.mjs\";\nimport runtime from \"@abaplint/runtime\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nasync function run() {\n await initializeABAP();\n const unit = new runtime.UnitTestResult();\n let clas;\n let locl;\n let meth;\n try {\\n`;\r\n for (const obj of reg.getObjects()) {\r\n if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {\r\n continue;\r\n }\r\n ret += `// --------------------------------------------\\n`;\r\n ret += ` clas = unit.addObject(\"${obj.getName()}\");\\n`;\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {\r\n // todo, fix, there might be global test methods\r\n continue;\r\n }\r\n ret += ` {\n const {${def.name}} = await import(\"./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs\");\n locl = clas.addTestClass(\"${def.name}\");\n if (${def.name}.class_setup) await ${def.name}.class_setup();\\n`;\r\n for (const m of def.methods) {\r\n if (m.isForTesting === false) {\r\n continue;\r\n }\r\n const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);\r\n if (skipThis) {\r\n ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\\n`;\r\n ret += ` meth = locl.addMethod(\"${m.name}\");\\n`;\r\n ret += ` meth.skip();\\n`;\r\n continue;\r\n }\r\n ret += ` {\\n const test = await (new ${def.name}()).constructor_();\\n`;\r\n ret += ` if (test.setup) await test.setup();\\n`;\r\n ret += ` console.log(\"${obj.getName()}: running ${def.name}->${m.name}\");\\n`;\r\n ret += ` meth = locl.addMethod(\"${m.name}\");\\n`;\r\n ret += ` await test.${m.name}();\\n`;\r\n ret += ` meth.pass();\\n`;\r\n ret += ` if (test.teardown) await test.teardown();\\n`;\r\n ret += ` }\\n`;\r\n }\r\n ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\\n`;\r\n ret += ` }\\n`;\r\n }\r\n }\r\n }\r\n ret += `// -------------------END-------------------\n console.log(abap.console.get());\n fs.writeFileSync(__dirname + path.sep + \"_output.xml\", unit.xUnitXML());\n } catch (e) {\n if (meth) {\n meth.fail();\n }\n console.log(abap.console.get());\n fs.writeFileSync(__dirname + path.sep + \"_output.xml\", unit.xUnitXML());\n throw e;\n }\n}\n\nrun().then(() => {\n process.exit(0);\n}).catch((err) => {\n console.log(err);\n process.exit(1);\n});`;\r\n return ret;\r\n }\r\n buildImports(reg, useImport) {\r\n // note: ES modules are hoised, so use the dynamic import(), due to setting of globalThis.abap\r\n // some sorting required: eg. a class constructor using constant from interface\r\n const list = [];\r\n const late = [];\r\n const imp = (filename) => {\r\n if (useImport === true) {\r\n return `import \"./${filename}.mjs\";`;\r\n }\r\n else {\r\n return `await import(\"./${filename}.mjs\");`;\r\n }\r\n };\r\n for (const obj of reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table\r\n || obj instanceof abaplint.Objects.DataElement\r\n || obj instanceof abaplint.Objects.LockObject\r\n || obj instanceof abaplint.Objects.TableType) {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n }\r\n for (const obj of reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.FunctionGroup) {\r\n for (const m of obj.getModules()) {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.fugr.${this.escapeNamespace(m.getName().toLowerCase())}`));\r\n }\r\n }\r\n else if (obj instanceof abaplint.Objects.Class) {\r\n if (obj.getName().toUpperCase() !== \"CL_ABAP_CHAR_UTILITIES\"\r\n && this.hasClassConstructor(reg, obj)) {\r\n // this will not solve all problems with class constors 100%, but probably good enough\r\n late.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n else {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n }\r\n else if (obj instanceof abaplint.Objects.Interface) {\r\n list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));\r\n }\r\n }\r\n return [...list.sort(), ...late].join(\"\\n\");\r\n }\r\n // class constructors might make early use of eg. constants from interfaces\r\n // sub classes will import() super classes and trigger a class constructor of the super\r\n hasClassConstructor(reg, clas) {\r\n var _a, _b;\r\n if (((_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getMethodDefinitions().getByName(\"CLASS_CONSTRUCTOR\")) !== undefined) {\r\n return true;\r\n }\r\n const sup = (_b = clas.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass();\r\n if (sup !== undefined) {\r\n const superClass = reg.getObject(\"CLAS\", sup);\r\n if (superClass) {\r\n return this.hasClassConstructor(reg, superClass);\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UnitTest = UnitTest;\r\n//# sourceMappingURL=unit_test.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/unit_test.js?");
|
|
15849
15849
|
|
|
15850
15850
|
/***/ }),
|
|
15851
15851
|
|
|
@@ -16374,7 +16374,7 @@ module.exports = require("util");
|
|
|
16374
16374
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
16375
16375
|
|
|
16376
16376
|
"use strict";
|
|
16377
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// This is a generated file. Do not edit.\nvar Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nvar ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\nvar ID_Continue = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u09FC\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9-\\u0AFF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D00-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDE00-\\uDE3E\\uDE47\\uDE50-\\uDE83\\uDE86-\\uDE99\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nvar unicode = {\n\tSpace_Separator: Space_Separator,\n\tID_Start: ID_Start,\n\tID_Continue: ID_Continue\n};\n\nvar util = {\n isSpaceSeparator (c) {\n return typeof c === 'string' && unicode.Space_Separator.test(c)\n },\n\n isIdStartChar (c) {\n return typeof c === 'string' && (\n (c >= 'a' && c <= 'z') ||\n (c >= 'A' && c <= 'Z') ||\n (c === '$') || (c === '_') ||\n unicode.ID_Start.test(c)\n )\n },\n\n isIdContinueChar (c) {\n return typeof c === 'string' && (\n (c >= 'a' && c <= 'z') ||\n (c >= 'A' && c <= 'Z') ||\n (c >= '0' && c <= '9') ||\n (c === '$') || (c === '_') ||\n (c === '\\u200C') || (c === '\\u200D') ||\n unicode.ID_Continue.test(c)\n )\n },\n\n isDigit (c) {\n return typeof c === 'string' && /[0-9]/.test(c)\n },\n\n isHexDigit (c) {\n return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n },\n};\n\nlet source;\nlet parseState;\nlet stack;\nlet pos;\nlet line;\nlet column;\nlet token;\nlet key;\nlet root;\n\nvar parse = function parse (text, reviver) {\n source = String(text);\n parseState = 'start';\n stack = [];\n pos = 0;\n line = 1;\n column = 0;\n token = undefined;\n key = undefined;\n root = undefined;\n\n do {\n token = lex();\n\n // This code is unreachable.\n // if (!parseStates[parseState]) {\n // throw invalidParseState()\n // }\n\n parseStates[parseState]();\n } while (token.type !== 'eof')\n\n if (typeof reviver === 'function') {\n return internalize({'': root}, '', reviver)\n }\n\n return root\n};\n\nfunction internalize (holder, name, reviver) {\n const value = holder[name];\n if (value != null && typeof value === 'object') {\n for (const key in value) {\n const replacement = internalize(value, key, reviver);\n if (replacement === undefined) {\n delete value[key];\n } else {\n value[key] = replacement;\n }\n }\n }\n\n return reviver.call(holder, name, value)\n}\n\nlet lexState;\nlet buffer;\nlet doubleQuote;\nlet sign;\nlet c;\n\nfunction lex () {\n lexState = 'default';\n buffer = '';\n doubleQuote = false;\n sign = 1;\n\n for (;;) {\n c = peek();\n\n // This code is unreachable.\n // if (!lexStates[lexState]) {\n // throw invalidLexState(lexState)\n // }\n\n const token = lexStates[lexState]();\n if (token) {\n return token\n }\n }\n}\n\nfunction peek () {\n if (source[pos]) {\n return String.fromCodePoint(source.codePointAt(pos))\n }\n}\n\nfunction read () {\n const c = peek();\n\n if (c === '\\n') {\n line++;\n column = 0;\n } else if (c) {\n column += c.length;\n } else {\n column++;\n }\n\n if (c) {\n pos += c.length;\n }\n\n return c\n}\n\nconst lexStates = {\n default () {\n switch (c) {\n case '\\t':\n case '\\v':\n case '\\f':\n case ' ':\n case '\\u00A0':\n case '\\uFEFF':\n case '\\n':\n case '\\r':\n case '\\u2028':\n case '\\u2029':\n read();\n return\n\n case '/':\n read();\n lexState = 'comment';\n return\n\n case undefined:\n read();\n return newToken('eof')\n }\n\n if (util.isSpaceSeparator(c)) {\n read();\n return\n }\n\n // This code is unreachable.\n // if (!lexStates[parseState]) {\n // throw invalidLexState(parseState)\n // }\n\n return lexStates[parseState]()\n },\n\n comment () {\n switch (c) {\n case '*':\n read();\n lexState = 'multiLineComment';\n return\n\n case '/':\n read();\n lexState = 'singleLineComment';\n return\n }\n\n throw invalidChar(read())\n },\n\n multiLineComment () {\n switch (c) {\n case '*':\n read();\n lexState = 'multiLineCommentAsterisk';\n return\n\n case undefined:\n throw invalidChar(read())\n }\n\n read();\n },\n\n multiLineCommentAsterisk () {\n switch (c) {\n case '*':\n read();\n return\n\n case '/':\n read();\n lexState = 'default';\n return\n\n case undefined:\n throw invalidChar(read())\n }\n\n read();\n lexState = 'multiLineComment';\n },\n\n singleLineComment () {\n switch (c) {\n case '\\n':\n case '\\r':\n case '\\u2028':\n case '\\u2029':\n read();\n lexState = 'default';\n return\n\n case undefined:\n read();\n return newToken('eof')\n }\n\n read();\n },\n\n value () {\n switch (c) {\n case '{':\n case '[':\n return newToken('punctuator', read())\n\n case 'n':\n read();\n literal('ull');\n return newToken('null', null)\n\n case 't':\n read();\n literal('rue');\n return newToken('boolean', true)\n\n case 'f':\n read();\n literal('alse');\n return newToken('boolean', false)\n\n case '-':\n case '+':\n if (read() === '-') {\n sign = -1;\n }\n\n lexState = 'sign';\n return\n\n case '.':\n buffer = read();\n lexState = 'decimalPointLeading';\n return\n\n case '0':\n buffer = read();\n lexState = 'zero';\n return\n\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n buffer = read();\n lexState = 'decimalInteger';\n return\n\n case 'I':\n read();\n literal('nfinity');\n return newToken('numeric', Infinity)\n\n case 'N':\n read();\n literal('aN');\n return newToken('numeric', NaN)\n\n case '\"':\n case \"'\":\n doubleQuote = (read() === '\"');\n buffer = '';\n lexState = 'string';\n return\n }\n\n throw invalidChar(read())\n },\n\n identifierNameStartEscape () {\n if (c !== 'u') {\n throw invalidChar(read())\n }\n\n read();\n const u = unicodeEscape();\n switch (u) {\n case '$':\n case '_':\n break\n\n default:\n if (!util.isIdStartChar(u)) {\n throw invalidIdentifier()\n }\n\n break\n }\n\n buffer += u;\n lexState = 'identifierName';\n },\n\n identifierName () {\n switch (c) {\n case '$':\n case '_':\n case '\\u200C':\n case '\\u200D':\n buffer += read();\n return\n\n case '\\\\':\n read();\n lexState = 'identifierNameEscape';\n return\n }\n\n if (util.isIdContinueChar(c)) {\n buffer += read();\n return\n }\n\n return newToken('identifier', buffer)\n },\n\n identifierNameEscape () {\n if (c !== 'u') {\n throw invalidChar(read())\n }\n\n read();\n const u = unicodeEscape();\n switch (u) {\n case '$':\n case '_':\n case '\\u200C':\n case '\\u200D':\n break\n\n default:\n if (!util.isIdContinueChar(u)) {\n throw invalidIdentifier()\n }\n\n break\n }\n\n buffer += u;\n lexState = 'identifierName';\n },\n\n sign () {\n switch (c) {\n case '.':\n buffer = read();\n lexState = 'decimalPointLeading';\n return\n\n case '0':\n buffer = read();\n lexState = 'zero';\n return\n\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n buffer = read();\n lexState = 'decimalInteger';\n return\n\n case 'I':\n read();\n literal('nfinity');\n return newToken('numeric', sign * Infinity)\n\n case 'N':\n read();\n literal('aN');\n return newToken('numeric', NaN)\n }\n\n throw invalidChar(read())\n },\n\n zero () {\n switch (c) {\n case '.':\n buffer += read();\n lexState = 'decimalPoint';\n return\n\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n\n case 'x':\n case 'X':\n buffer += read();\n lexState = 'hexadecimal';\n return\n }\n\n return newToken('numeric', sign * 0)\n },\n\n decimalInteger () {\n switch (c) {\n case '.':\n buffer += read();\n lexState = 'decimalPoint';\n return\n\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalPointLeading () {\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalFraction';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalPoint () {\n switch (c) {\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalFraction';\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalFraction () {\n switch (c) {\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalExponent () {\n switch (c) {\n case '+':\n case '-':\n buffer += read();\n lexState = 'decimalExponentSign';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalExponentInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalExponentSign () {\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalExponentInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalExponentInteger () {\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n hexadecimal () {\n if (util.isHexDigit(c)) {\n buffer += read();\n lexState = 'hexadecimalInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n hexadecimalInteger () {\n if (util.isHexDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n string () {\n switch (c) {\n case '\\\\':\n read();\n buffer += escape();\n return\n\n case '\"':\n if (doubleQuote) {\n read();\n return newToken('string', buffer)\n }\n\n buffer += read();\n return\n\n case \"'\":\n if (!doubleQuote) {\n read();\n return newToken('string', buffer)\n }\n\n buffer += read();\n return\n\n case '\\n':\n case '\\r':\n throw invalidChar(read())\n\n case '\\u2028':\n case '\\u2029':\n separatorChar(c);\n break\n\n case undefined:\n throw invalidChar(read())\n }\n\n buffer += read();\n },\n\n start () {\n switch (c) {\n case '{':\n case '[':\n return newToken('punctuator', read())\n\n // This code is unreachable since the default lexState handles eof.\n // case undefined:\n // return newToken('eof')\n }\n\n lexState = 'value';\n },\n\n beforePropertyName () {\n switch (c) {\n case '$':\n case '_':\n buffer = read();\n lexState = 'identifierName';\n return\n\n case '\\\\':\n read();\n lexState = 'identifierNameStartEscape';\n return\n\n case '}':\n return newToken('punctuator', read())\n\n case '\"':\n case \"'\":\n doubleQuote = (read() === '\"');\n lexState = 'string';\n return\n }\n\n if (util.isIdStartChar(c)) {\n buffer += read();\n lexState = 'identifierName';\n return\n }\n\n throw invalidChar(read())\n },\n\n afterPropertyName () {\n if (c === ':') {\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n beforePropertyValue () {\n lexState = 'value';\n },\n\n afterPropertyValue () {\n switch (c) {\n case ',':\n case '}':\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n beforeArrayValue () {\n if (c === ']') {\n return newToken('punctuator', read())\n }\n\n lexState = 'value';\n },\n\n afterArrayValue () {\n switch (c) {\n case ',':\n case ']':\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n end () {\n // This code is unreachable since it's handled by the default lexState.\n // if (c === undefined) {\n // read()\n // return newToken('eof')\n // }\n\n throw invalidChar(read())\n },\n};\n\nfunction newToken (type, value) {\n return {\n type,\n value,\n line,\n column,\n }\n}\n\nfunction literal (s) {\n for (const c of s) {\n const p = peek();\n\n if (p !== c) {\n throw invalidChar(read())\n }\n\n read();\n }\n}\n\nfunction escape () {\n const c = peek();\n switch (c) {\n case 'b':\n read();\n return '\\b'\n\n case 'f':\n read();\n return '\\f'\n\n case 'n':\n read();\n return '\\n'\n\n case 'r':\n read();\n return '\\r'\n\n case 't':\n read();\n return '\\t'\n\n case 'v':\n read();\n return '\\v'\n\n case '0':\n read();\n if (util.isDigit(peek())) {\n throw invalidChar(read())\n }\n\n return '\\0'\n\n case 'x':\n read();\n return hexEscape()\n\n case 'u':\n read();\n return unicodeEscape()\n\n case '\\n':\n case '\\u2028':\n case '\\u2029':\n read();\n return ''\n\n case '\\r':\n read();\n if (peek() === '\\n') {\n read();\n }\n\n return ''\n\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n throw invalidChar(read())\n\n case undefined:\n throw invalidChar(read())\n }\n\n return read()\n}\n\nfunction hexEscape () {\n let buffer = '';\n let c = peek();\n\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n\n c = peek();\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n\n return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nfunction unicodeEscape () {\n let buffer = '';\n let count = 4;\n\n while (count-- > 0) {\n const c = peek();\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n }\n\n return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nconst parseStates = {\n start () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n push();\n },\n\n beforePropertyName () {\n switch (token.type) {\n case 'identifier':\n case 'string':\n key = token.value;\n parseState = 'afterPropertyName';\n return\n\n case 'punctuator':\n // This code is unreachable since it's handled by the lexState.\n // if (token.value !== '}') {\n // throw invalidToken()\n // }\n\n pop();\n return\n\n case 'eof':\n throw invalidEOF()\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n afterPropertyName () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator' || token.value !== ':') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n parseState = 'beforePropertyValue';\n },\n\n beforePropertyValue () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n push();\n },\n\n beforeArrayValue () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n if (token.type === 'punctuator' && token.value === ']') {\n pop();\n return\n }\n\n push();\n },\n\n afterPropertyValue () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n switch (token.value) {\n case ',':\n parseState = 'beforePropertyName';\n return\n\n case '}':\n pop();\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n afterArrayValue () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n switch (token.value) {\n case ',':\n parseState = 'beforeArrayValue';\n return\n\n case ']':\n pop();\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n end () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'eof') {\n // throw invalidToken()\n // }\n },\n};\n\nfunction push () {\n let value;\n\n switch (token.type) {\n case 'punctuator':\n switch (token.value) {\n case '{':\n value = {};\n break\n\n case '[':\n value = [];\n break\n }\n\n break\n\n case 'null':\n case 'boolean':\n case 'numeric':\n case 'string':\n value = token.value;\n break\n\n // This code is unreachable.\n // default:\n // throw invalidToken()\n }\n\n if (root === undefined) {\n root = value;\n } else {\n const parent = stack[stack.length - 1];\n if (Array.isArray(parent)) {\n parent.push(value);\n } else {\n parent[key] = value;\n }\n }\n\n if (value !== null && typeof value === 'object') {\n stack.push(value);\n\n if (Array.isArray(value)) {\n parseState = 'beforeArrayValue';\n } else {\n parseState = 'beforePropertyName';\n }\n } else {\n const current = stack[stack.length - 1];\n if (current == null) {\n parseState = 'end';\n } else if (Array.isArray(current)) {\n parseState = 'afterArrayValue';\n } else {\n parseState = 'afterPropertyValue';\n }\n }\n}\n\nfunction pop () {\n stack.pop();\n\n const current = stack[stack.length - 1];\n if (current == null) {\n parseState = 'end';\n } else if (Array.isArray(current)) {\n parseState = 'afterArrayValue';\n } else {\n parseState = 'afterPropertyValue';\n }\n}\n\n// This code is unreachable.\n// function invalidParseState () {\n// return new Error(`JSON5: invalid parse state '${parseState}'`)\n// }\n\n// This code is unreachable.\n// function invalidLexState (state) {\n// return new Error(`JSON5: invalid lex state '${state}'`)\n// }\n\nfunction invalidChar (c) {\n if (c === undefined) {\n return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n }\n\n return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n}\n\nfunction invalidEOF () {\n return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n}\n\n// This code is unreachable.\n// function invalidToken () {\n// if (token.type === 'eof') {\n// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n// }\n\n// const c = String.fromCodePoint(token.value.codePointAt(0))\n// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n// }\n\nfunction invalidIdentifier () {\n column -= 5;\n return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`)\n}\n\nfunction separatorChar (c) {\n console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`);\n}\n\nfunction formatChar (c) {\n const replacements = {\n \"'\": \"\\\\'\",\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\v': '\\\\v',\n '\\0': '\\\\0',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n };\n\n if (replacements[c]) {\n return replacements[c]\n }\n\n if (c < ' ') {\n const hexString = c.charCodeAt(0).toString(16);\n return '\\\\x' + ('00' + hexString).substring(hexString.length)\n }\n\n return c\n}\n\nfunction syntaxError (message) {\n const err = new SyntaxError(message);\n err.lineNumber = line;\n err.columnNumber = column;\n return err\n}\n\nvar stringify = function stringify (value, replacer, space) {\n const stack = [];\n let indent = '';\n let propertyList;\n let replacerFunc;\n let gap = '';\n let quote;\n\n if (\n replacer != null &&\n typeof replacer === 'object' &&\n !Array.isArray(replacer)\n ) {\n space = replacer.space;\n quote = replacer.quote;\n replacer = replacer.replacer;\n }\n\n if (typeof replacer === 'function') {\n replacerFunc = replacer;\n } else if (Array.isArray(replacer)) {\n propertyList = [];\n for (const v of replacer) {\n let item;\n\n if (typeof v === 'string') {\n item = v;\n } else if (\n typeof v === 'number' ||\n v instanceof String ||\n v instanceof Number\n ) {\n item = String(v);\n }\n\n if (item !== undefined && propertyList.indexOf(item) < 0) {\n propertyList.push(item);\n }\n }\n }\n\n if (space instanceof Number) {\n space = Number(space);\n } else if (space instanceof String) {\n space = String(space);\n }\n\n if (typeof space === 'number') {\n if (space > 0) {\n space = Math.min(10, Math.floor(space));\n gap = ' '.substr(0, space);\n }\n } else if (typeof space === 'string') {\n gap = space.substr(0, 10);\n }\n\n return serializeProperty('', {'': value})\n\n function serializeProperty (key, holder) {\n let value = holder[key];\n if (value != null) {\n if (typeof value.toJSON5 === 'function') {\n value = value.toJSON5(key);\n } else if (typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n }\n\n if (replacerFunc) {\n value = replacerFunc.call(holder, key, value);\n }\n\n if (value instanceof Number) {\n value = Number(value);\n } else if (value instanceof String) {\n value = String(value);\n } else if (value instanceof Boolean) {\n value = value.valueOf();\n }\n\n switch (value) {\n case null: return 'null'\n case true: return 'true'\n case false: return 'false'\n }\n\n if (typeof value === 'string') {\n return quoteString(value, false)\n }\n\n if (typeof value === 'number') {\n return String(value)\n }\n\n if (typeof value === 'object') {\n return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n }\n\n return undefined\n }\n\n function quoteString (value) {\n const quotes = {\n \"'\": 0.1,\n '\"': 0.2,\n };\n\n const replacements = {\n \"'\": \"\\\\'\",\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\v': '\\\\v',\n '\\0': '\\\\0',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n };\n\n let product = '';\n\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n switch (c) {\n case \"'\":\n case '\"':\n quotes[c]++;\n product += c;\n continue\n\n case '\\0':\n if (util.isDigit(value[i + 1])) {\n product += '\\\\x00';\n continue\n }\n }\n\n if (replacements[c]) {\n product += replacements[c];\n continue\n }\n\n if (c < ' ') {\n let hexString = c.charCodeAt(0).toString(16);\n product += '\\\\x' + ('00' + hexString).substring(hexString.length);\n continue\n }\n\n product += c;\n }\n\n const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b);\n\n product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);\n\n return quoteChar + product + quoteChar\n }\n\n function serializeObject (value) {\n if (stack.indexOf(value) >= 0) {\n throw TypeError('Converting circular structure to JSON5')\n }\n\n stack.push(value);\n\n let stepback = indent;\n indent = indent + gap;\n\n let keys = propertyList || Object.keys(value);\n let partial = [];\n for (const key of keys) {\n const propertyString = serializeProperty(key, value);\n if (propertyString !== undefined) {\n let member = serializeKey(key) + ':';\n if (gap !== '') {\n member += ' ';\n }\n member += propertyString;\n partial.push(member);\n }\n }\n\n let final;\n if (partial.length === 0) {\n final = '{}';\n } else {\n let properties;\n if (gap === '') {\n properties = partial.join(',');\n final = '{' + properties + '}';\n } else {\n let separator = ',\\n' + indent;\n properties = partial.join(separator);\n final = '{\\n' + indent + properties + ',\\n' + stepback + '}';\n }\n }\n\n stack.pop();\n indent = stepback;\n return final\n }\n\n function serializeKey (key) {\n if (key.length === 0) {\n return quoteString(key, true)\n }\n\n const firstChar = String.fromCodePoint(key.codePointAt(0));\n if (!util.isIdStartChar(firstChar)) {\n return quoteString(key, true)\n }\n\n for (let i = firstChar.length; i < key.length; i++) {\n if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n return quoteString(key, true)\n }\n }\n\n return key\n }\n\n function serializeArray (value) {\n if (stack.indexOf(value) >= 0) {\n throw TypeError('Converting circular structure to JSON5')\n }\n\n stack.push(value);\n\n let stepback = indent;\n indent = indent + gap;\n\n let partial = [];\n for (let i = 0; i < value.length; i++) {\n const propertyString = serializeProperty(String(i), value);\n partial.push((propertyString !== undefined) ? propertyString : 'null');\n }\n\n let final;\n if (partial.length === 0) {\n final = '[]';\n } else {\n if (gap === '') {\n let properties = partial.join(',');\n final = '[' + properties + ']';\n } else {\n let separator = ',\\n' + indent;\n let properties = partial.join(separator);\n final = '[\\n' + indent + properties + ',\\n' + stepback + ']';\n }\n }\n\n stack.pop();\n indent = stepback;\n return final\n }\n};\n\nconst JSON5 = {\n parse,\n stringify,\n};\n\nvar lib = JSON5;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lib);\n\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/json5/dist/index.mjs?");
|
|
16377
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// This is a generated file. Do not edit.\nvar Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nvar ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\nvar ID_Continue = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u09FC\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9-\\u0AFF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D00-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDE00-\\uDE3E\\uDE47\\uDE50-\\uDE83\\uDE86-\\uDE99\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nvar unicode = {\n\tSpace_Separator: Space_Separator,\n\tID_Start: ID_Start,\n\tID_Continue: ID_Continue\n};\n\nvar util = {\n isSpaceSeparator (c) {\n return typeof c === 'string' && unicode.Space_Separator.test(c)\n },\n\n isIdStartChar (c) {\n return typeof c === 'string' && (\n (c >= 'a' && c <= 'z') ||\n (c >= 'A' && c <= 'Z') ||\n (c === '$') || (c === '_') ||\n unicode.ID_Start.test(c)\n )\n },\n\n isIdContinueChar (c) {\n return typeof c === 'string' && (\n (c >= 'a' && c <= 'z') ||\n (c >= 'A' && c <= 'Z') ||\n (c >= '0' && c <= '9') ||\n (c === '$') || (c === '_') ||\n (c === '\\u200C') || (c === '\\u200D') ||\n unicode.ID_Continue.test(c)\n )\n },\n\n isDigit (c) {\n return typeof c === 'string' && /[0-9]/.test(c)\n },\n\n isHexDigit (c) {\n return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n },\n};\n\nlet source;\nlet parseState;\nlet stack;\nlet pos;\nlet line;\nlet column;\nlet token;\nlet key;\nlet root;\n\nvar parse = function parse (text, reviver) {\n source = String(text);\n parseState = 'start';\n stack = [];\n pos = 0;\n line = 1;\n column = 0;\n token = undefined;\n key = undefined;\n root = undefined;\n\n do {\n token = lex();\n\n // This code is unreachable.\n // if (!parseStates[parseState]) {\n // throw invalidParseState()\n // }\n\n parseStates[parseState]();\n } while (token.type !== 'eof')\n\n if (typeof reviver === 'function') {\n return internalize({'': root}, '', reviver)\n }\n\n return root\n};\n\nfunction internalize (holder, name, reviver) {\n const value = holder[name];\n if (value != null && typeof value === 'object') {\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const key = String(i);\n const replacement = internalize(value, key, reviver);\n if (replacement === undefined) {\n delete value[key];\n } else {\n Object.defineProperty(value, key, {\n value: replacement,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n }\n } else {\n for (const key in value) {\n const replacement = internalize(value, key, reviver);\n if (replacement === undefined) {\n delete value[key];\n } else {\n Object.defineProperty(value, key, {\n value: replacement,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n }\n }\n }\n\n return reviver.call(holder, name, value)\n}\n\nlet lexState;\nlet buffer;\nlet doubleQuote;\nlet sign;\nlet c;\n\nfunction lex () {\n lexState = 'default';\n buffer = '';\n doubleQuote = false;\n sign = 1;\n\n for (;;) {\n c = peek();\n\n // This code is unreachable.\n // if (!lexStates[lexState]) {\n // throw invalidLexState(lexState)\n // }\n\n const token = lexStates[lexState]();\n if (token) {\n return token\n }\n }\n}\n\nfunction peek () {\n if (source[pos]) {\n return String.fromCodePoint(source.codePointAt(pos))\n }\n}\n\nfunction read () {\n const c = peek();\n\n if (c === '\\n') {\n line++;\n column = 0;\n } else if (c) {\n column += c.length;\n } else {\n column++;\n }\n\n if (c) {\n pos += c.length;\n }\n\n return c\n}\n\nconst lexStates = {\n default () {\n switch (c) {\n case '\\t':\n case '\\v':\n case '\\f':\n case ' ':\n case '\\u00A0':\n case '\\uFEFF':\n case '\\n':\n case '\\r':\n case '\\u2028':\n case '\\u2029':\n read();\n return\n\n case '/':\n read();\n lexState = 'comment';\n return\n\n case undefined:\n read();\n return newToken('eof')\n }\n\n if (util.isSpaceSeparator(c)) {\n read();\n return\n }\n\n // This code is unreachable.\n // if (!lexStates[parseState]) {\n // throw invalidLexState(parseState)\n // }\n\n return lexStates[parseState]()\n },\n\n comment () {\n switch (c) {\n case '*':\n read();\n lexState = 'multiLineComment';\n return\n\n case '/':\n read();\n lexState = 'singleLineComment';\n return\n }\n\n throw invalidChar(read())\n },\n\n multiLineComment () {\n switch (c) {\n case '*':\n read();\n lexState = 'multiLineCommentAsterisk';\n return\n\n case undefined:\n throw invalidChar(read())\n }\n\n read();\n },\n\n multiLineCommentAsterisk () {\n switch (c) {\n case '*':\n read();\n return\n\n case '/':\n read();\n lexState = 'default';\n return\n\n case undefined:\n throw invalidChar(read())\n }\n\n read();\n lexState = 'multiLineComment';\n },\n\n singleLineComment () {\n switch (c) {\n case '\\n':\n case '\\r':\n case '\\u2028':\n case '\\u2029':\n read();\n lexState = 'default';\n return\n\n case undefined:\n read();\n return newToken('eof')\n }\n\n read();\n },\n\n value () {\n switch (c) {\n case '{':\n case '[':\n return newToken('punctuator', read())\n\n case 'n':\n read();\n literal('ull');\n return newToken('null', null)\n\n case 't':\n read();\n literal('rue');\n return newToken('boolean', true)\n\n case 'f':\n read();\n literal('alse');\n return newToken('boolean', false)\n\n case '-':\n case '+':\n if (read() === '-') {\n sign = -1;\n }\n\n lexState = 'sign';\n return\n\n case '.':\n buffer = read();\n lexState = 'decimalPointLeading';\n return\n\n case '0':\n buffer = read();\n lexState = 'zero';\n return\n\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n buffer = read();\n lexState = 'decimalInteger';\n return\n\n case 'I':\n read();\n literal('nfinity');\n return newToken('numeric', Infinity)\n\n case 'N':\n read();\n literal('aN');\n return newToken('numeric', NaN)\n\n case '\"':\n case \"'\":\n doubleQuote = (read() === '\"');\n buffer = '';\n lexState = 'string';\n return\n }\n\n throw invalidChar(read())\n },\n\n identifierNameStartEscape () {\n if (c !== 'u') {\n throw invalidChar(read())\n }\n\n read();\n const u = unicodeEscape();\n switch (u) {\n case '$':\n case '_':\n break\n\n default:\n if (!util.isIdStartChar(u)) {\n throw invalidIdentifier()\n }\n\n break\n }\n\n buffer += u;\n lexState = 'identifierName';\n },\n\n identifierName () {\n switch (c) {\n case '$':\n case '_':\n case '\\u200C':\n case '\\u200D':\n buffer += read();\n return\n\n case '\\\\':\n read();\n lexState = 'identifierNameEscape';\n return\n }\n\n if (util.isIdContinueChar(c)) {\n buffer += read();\n return\n }\n\n return newToken('identifier', buffer)\n },\n\n identifierNameEscape () {\n if (c !== 'u') {\n throw invalidChar(read())\n }\n\n read();\n const u = unicodeEscape();\n switch (u) {\n case '$':\n case '_':\n case '\\u200C':\n case '\\u200D':\n break\n\n default:\n if (!util.isIdContinueChar(u)) {\n throw invalidIdentifier()\n }\n\n break\n }\n\n buffer += u;\n lexState = 'identifierName';\n },\n\n sign () {\n switch (c) {\n case '.':\n buffer = read();\n lexState = 'decimalPointLeading';\n return\n\n case '0':\n buffer = read();\n lexState = 'zero';\n return\n\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n buffer = read();\n lexState = 'decimalInteger';\n return\n\n case 'I':\n read();\n literal('nfinity');\n return newToken('numeric', sign * Infinity)\n\n case 'N':\n read();\n literal('aN');\n return newToken('numeric', NaN)\n }\n\n throw invalidChar(read())\n },\n\n zero () {\n switch (c) {\n case '.':\n buffer += read();\n lexState = 'decimalPoint';\n return\n\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n\n case 'x':\n case 'X':\n buffer += read();\n lexState = 'hexadecimal';\n return\n }\n\n return newToken('numeric', sign * 0)\n },\n\n decimalInteger () {\n switch (c) {\n case '.':\n buffer += read();\n lexState = 'decimalPoint';\n return\n\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalPointLeading () {\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalFraction';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalPoint () {\n switch (c) {\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalFraction';\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalFraction () {\n switch (c) {\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalExponent () {\n switch (c) {\n case '+':\n case '-':\n buffer += read();\n lexState = 'decimalExponentSign';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalExponentInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalExponentSign () {\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalExponentInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalExponentInteger () {\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n hexadecimal () {\n if (util.isHexDigit(c)) {\n buffer += read();\n lexState = 'hexadecimalInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n hexadecimalInteger () {\n if (util.isHexDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n string () {\n switch (c) {\n case '\\\\':\n read();\n buffer += escape();\n return\n\n case '\"':\n if (doubleQuote) {\n read();\n return newToken('string', buffer)\n }\n\n buffer += read();\n return\n\n case \"'\":\n if (!doubleQuote) {\n read();\n return newToken('string', buffer)\n }\n\n buffer += read();\n return\n\n case '\\n':\n case '\\r':\n throw invalidChar(read())\n\n case '\\u2028':\n case '\\u2029':\n separatorChar(c);\n break\n\n case undefined:\n throw invalidChar(read())\n }\n\n buffer += read();\n },\n\n start () {\n switch (c) {\n case '{':\n case '[':\n return newToken('punctuator', read())\n\n // This code is unreachable since the default lexState handles eof.\n // case undefined:\n // return newToken('eof')\n }\n\n lexState = 'value';\n },\n\n beforePropertyName () {\n switch (c) {\n case '$':\n case '_':\n buffer = read();\n lexState = 'identifierName';\n return\n\n case '\\\\':\n read();\n lexState = 'identifierNameStartEscape';\n return\n\n case '}':\n return newToken('punctuator', read())\n\n case '\"':\n case \"'\":\n doubleQuote = (read() === '\"');\n lexState = 'string';\n return\n }\n\n if (util.isIdStartChar(c)) {\n buffer += read();\n lexState = 'identifierName';\n return\n }\n\n throw invalidChar(read())\n },\n\n afterPropertyName () {\n if (c === ':') {\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n beforePropertyValue () {\n lexState = 'value';\n },\n\n afterPropertyValue () {\n switch (c) {\n case ',':\n case '}':\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n beforeArrayValue () {\n if (c === ']') {\n return newToken('punctuator', read())\n }\n\n lexState = 'value';\n },\n\n afterArrayValue () {\n switch (c) {\n case ',':\n case ']':\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n end () {\n // This code is unreachable since it's handled by the default lexState.\n // if (c === undefined) {\n // read()\n // return newToken('eof')\n // }\n\n throw invalidChar(read())\n },\n};\n\nfunction newToken (type, value) {\n return {\n type,\n value,\n line,\n column,\n }\n}\n\nfunction literal (s) {\n for (const c of s) {\n const p = peek();\n\n if (p !== c) {\n throw invalidChar(read())\n }\n\n read();\n }\n}\n\nfunction escape () {\n const c = peek();\n switch (c) {\n case 'b':\n read();\n return '\\b'\n\n case 'f':\n read();\n return '\\f'\n\n case 'n':\n read();\n return '\\n'\n\n case 'r':\n read();\n return '\\r'\n\n case 't':\n read();\n return '\\t'\n\n case 'v':\n read();\n return '\\v'\n\n case '0':\n read();\n if (util.isDigit(peek())) {\n throw invalidChar(read())\n }\n\n return '\\0'\n\n case 'x':\n read();\n return hexEscape()\n\n case 'u':\n read();\n return unicodeEscape()\n\n case '\\n':\n case '\\u2028':\n case '\\u2029':\n read();\n return ''\n\n case '\\r':\n read();\n if (peek() === '\\n') {\n read();\n }\n\n return ''\n\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n throw invalidChar(read())\n\n case undefined:\n throw invalidChar(read())\n }\n\n return read()\n}\n\nfunction hexEscape () {\n let buffer = '';\n let c = peek();\n\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n\n c = peek();\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n\n return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nfunction unicodeEscape () {\n let buffer = '';\n let count = 4;\n\n while (count-- > 0) {\n const c = peek();\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n }\n\n return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nconst parseStates = {\n start () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n push();\n },\n\n beforePropertyName () {\n switch (token.type) {\n case 'identifier':\n case 'string':\n key = token.value;\n parseState = 'afterPropertyName';\n return\n\n case 'punctuator':\n // This code is unreachable since it's handled by the lexState.\n // if (token.value !== '}') {\n // throw invalidToken()\n // }\n\n pop();\n return\n\n case 'eof':\n throw invalidEOF()\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n afterPropertyName () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator' || token.value !== ':') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n parseState = 'beforePropertyValue';\n },\n\n beforePropertyValue () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n push();\n },\n\n beforeArrayValue () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n if (token.type === 'punctuator' && token.value === ']') {\n pop();\n return\n }\n\n push();\n },\n\n afterPropertyValue () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n switch (token.value) {\n case ',':\n parseState = 'beforePropertyName';\n return\n\n case '}':\n pop();\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n afterArrayValue () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n switch (token.value) {\n case ',':\n parseState = 'beforeArrayValue';\n return\n\n case ']':\n pop();\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n end () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'eof') {\n // throw invalidToken()\n // }\n },\n};\n\nfunction push () {\n let value;\n\n switch (token.type) {\n case 'punctuator':\n switch (token.value) {\n case '{':\n value = {};\n break\n\n case '[':\n value = [];\n break\n }\n\n break\n\n case 'null':\n case 'boolean':\n case 'numeric':\n case 'string':\n value = token.value;\n break\n\n // This code is unreachable.\n // default:\n // throw invalidToken()\n }\n\n if (root === undefined) {\n root = value;\n } else {\n const parent = stack[stack.length - 1];\n if (Array.isArray(parent)) {\n parent.push(value);\n } else {\n Object.defineProperty(parent, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n }\n\n if (value !== null && typeof value === 'object') {\n stack.push(value);\n\n if (Array.isArray(value)) {\n parseState = 'beforeArrayValue';\n } else {\n parseState = 'beforePropertyName';\n }\n } else {\n const current = stack[stack.length - 1];\n if (current == null) {\n parseState = 'end';\n } else if (Array.isArray(current)) {\n parseState = 'afterArrayValue';\n } else {\n parseState = 'afterPropertyValue';\n }\n }\n}\n\nfunction pop () {\n stack.pop();\n\n const current = stack[stack.length - 1];\n if (current == null) {\n parseState = 'end';\n } else if (Array.isArray(current)) {\n parseState = 'afterArrayValue';\n } else {\n parseState = 'afterPropertyValue';\n }\n}\n\n// This code is unreachable.\n// function invalidParseState () {\n// return new Error(`JSON5: invalid parse state '${parseState}'`)\n// }\n\n// This code is unreachable.\n// function invalidLexState (state) {\n// return new Error(`JSON5: invalid lex state '${state}'`)\n// }\n\nfunction invalidChar (c) {\n if (c === undefined) {\n return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n }\n\n return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n}\n\nfunction invalidEOF () {\n return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n}\n\n// This code is unreachable.\n// function invalidToken () {\n// if (token.type === 'eof') {\n// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n// }\n\n// const c = String.fromCodePoint(token.value.codePointAt(0))\n// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n// }\n\nfunction invalidIdentifier () {\n column -= 5;\n return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`)\n}\n\nfunction separatorChar (c) {\n console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`);\n}\n\nfunction formatChar (c) {\n const replacements = {\n \"'\": \"\\\\'\",\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\v': '\\\\v',\n '\\0': '\\\\0',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n };\n\n if (replacements[c]) {\n return replacements[c]\n }\n\n if (c < ' ') {\n const hexString = c.charCodeAt(0).toString(16);\n return '\\\\x' + ('00' + hexString).substring(hexString.length)\n }\n\n return c\n}\n\nfunction syntaxError (message) {\n const err = new SyntaxError(message);\n err.lineNumber = line;\n err.columnNumber = column;\n return err\n}\n\nvar stringify = function stringify (value, replacer, space) {\n const stack = [];\n let indent = '';\n let propertyList;\n let replacerFunc;\n let gap = '';\n let quote;\n\n if (\n replacer != null &&\n typeof replacer === 'object' &&\n !Array.isArray(replacer)\n ) {\n space = replacer.space;\n quote = replacer.quote;\n replacer = replacer.replacer;\n }\n\n if (typeof replacer === 'function') {\n replacerFunc = replacer;\n } else if (Array.isArray(replacer)) {\n propertyList = [];\n for (const v of replacer) {\n let item;\n\n if (typeof v === 'string') {\n item = v;\n } else if (\n typeof v === 'number' ||\n v instanceof String ||\n v instanceof Number\n ) {\n item = String(v);\n }\n\n if (item !== undefined && propertyList.indexOf(item) < 0) {\n propertyList.push(item);\n }\n }\n }\n\n if (space instanceof Number) {\n space = Number(space);\n } else if (space instanceof String) {\n space = String(space);\n }\n\n if (typeof space === 'number') {\n if (space > 0) {\n space = Math.min(10, Math.floor(space));\n gap = ' '.substr(0, space);\n }\n } else if (typeof space === 'string') {\n gap = space.substr(0, 10);\n }\n\n return serializeProperty('', {'': value})\n\n function serializeProperty (key, holder) {\n let value = holder[key];\n if (value != null) {\n if (typeof value.toJSON5 === 'function') {\n value = value.toJSON5(key);\n } else if (typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n }\n\n if (replacerFunc) {\n value = replacerFunc.call(holder, key, value);\n }\n\n if (value instanceof Number) {\n value = Number(value);\n } else if (value instanceof String) {\n value = String(value);\n } else if (value instanceof Boolean) {\n value = value.valueOf();\n }\n\n switch (value) {\n case null: return 'null'\n case true: return 'true'\n case false: return 'false'\n }\n\n if (typeof value === 'string') {\n return quoteString(value, false)\n }\n\n if (typeof value === 'number') {\n return String(value)\n }\n\n if (typeof value === 'object') {\n return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n }\n\n return undefined\n }\n\n function quoteString (value) {\n const quotes = {\n \"'\": 0.1,\n '\"': 0.2,\n };\n\n const replacements = {\n \"'\": \"\\\\'\",\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\v': '\\\\v',\n '\\0': '\\\\0',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n };\n\n let product = '';\n\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n switch (c) {\n case \"'\":\n case '\"':\n quotes[c]++;\n product += c;\n continue\n\n case '\\0':\n if (util.isDigit(value[i + 1])) {\n product += '\\\\x00';\n continue\n }\n }\n\n if (replacements[c]) {\n product += replacements[c];\n continue\n }\n\n if (c < ' ') {\n let hexString = c.charCodeAt(0).toString(16);\n product += '\\\\x' + ('00' + hexString).substring(hexString.length);\n continue\n }\n\n product += c;\n }\n\n const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b);\n\n product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);\n\n return quoteChar + product + quoteChar\n }\n\n function serializeObject (value) {\n if (stack.indexOf(value) >= 0) {\n throw TypeError('Converting circular structure to JSON5')\n }\n\n stack.push(value);\n\n let stepback = indent;\n indent = indent + gap;\n\n let keys = propertyList || Object.keys(value);\n let partial = [];\n for (const key of keys) {\n const propertyString = serializeProperty(key, value);\n if (propertyString !== undefined) {\n let member = serializeKey(key) + ':';\n if (gap !== '') {\n member += ' ';\n }\n member += propertyString;\n partial.push(member);\n }\n }\n\n let final;\n if (partial.length === 0) {\n final = '{}';\n } else {\n let properties;\n if (gap === '') {\n properties = partial.join(',');\n final = '{' + properties + '}';\n } else {\n let separator = ',\\n' + indent;\n properties = partial.join(separator);\n final = '{\\n' + indent + properties + ',\\n' + stepback + '}';\n }\n }\n\n stack.pop();\n indent = stepback;\n return final\n }\n\n function serializeKey (key) {\n if (key.length === 0) {\n return quoteString(key, true)\n }\n\n const firstChar = String.fromCodePoint(key.codePointAt(0));\n if (!util.isIdStartChar(firstChar)) {\n return quoteString(key, true)\n }\n\n for (let i = firstChar.length; i < key.length; i++) {\n if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n return quoteString(key, true)\n }\n }\n\n return key\n }\n\n function serializeArray (value) {\n if (stack.indexOf(value) >= 0) {\n throw TypeError('Converting circular structure to JSON5')\n }\n\n stack.push(value);\n\n let stepback = indent;\n indent = indent + gap;\n\n let partial = [];\n for (let i = 0; i < value.length; i++) {\n const propertyString = serializeProperty(String(i), value);\n partial.push((propertyString !== undefined) ? propertyString : 'null');\n }\n\n let final;\n if (partial.length === 0) {\n final = '[]';\n } else {\n if (gap === '') {\n let properties = partial.join(',');\n final = '[' + properties + ']';\n } else {\n let separator = ',\\n' + indent;\n let properties = partial.join(separator);\n final = '[\\n' + indent + properties + ',\\n' + stepback + ']';\n }\n }\n\n stack.pop();\n indent = stepback;\n return final\n }\n};\n\nconst JSON5 = {\n parse,\n stringify,\n};\n\nvar lib = JSON5;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lib);\n\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/json5/dist/index.mjs?");
|
|
16378
16378
|
|
|
16379
16379
|
/***/ })
|
|
16380
16380
|
|