@abaplint/cli 2.94.3 → 2.94.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +38 -5
- package/package.json +4 -4
package/build/cli.js
CHANGED
|
@@ -6726,7 +6726,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6726
6726
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6727
6727
|
|
|
6728
6728
|
"use strict";
|
|
6729
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BasicTypes = void 0;\r\n/* eslint-disable default-case */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\r\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass BasicTypes {\r\n constructor(filename, scope) {\r\n this.filename = filename;\r\n this.scope = scope;\r\n }\r\n lookupQualifiedName(name) {\r\n var _a;\r\n // argh, todo, rewrite this entire method, more argh\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = this.scope.findType(name);\r\n if (found) {\r\n return found;\r\n }\r\n if (name.includes(\"=>\")) {\r\n const split = name.split(\"=>\");\r\n const ooName = split[0];\r\n const typeName = split[1];\r\n const oo = this.scope.findObjectDefinition(ooName);\r\n if (oo) {\r\n if (typeName.includes(\"-\")) {\r\n const split = typeName.split(\"-\");\r\n const subTypeName = split[0];\r\n const fieldName = split[1];\r\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\r\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\r\n if (stru && struType instanceof basic_1.StructureType) {\r\n const f = struType.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\r\n }\r\n }\r\n }\r\n else {\r\n const f = oo.getTypeDefinitions().getByName(typeName);\r\n if (f) {\r\n return f;\r\n }\r\n }\r\n }\r\n }\r\n else if (name.includes(\"-\")) {\r\n const split = name.split(\"-\");\r\n const typeName = split[0];\r\n const fieldName = split[1];\r\n const type = this.scope.findType(typeName);\r\n if (type) {\r\n const stru = type.getType();\r\n if (stru instanceof basic_1.StructureType) {\r\n const f = stru.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\r\n }\r\n }\r\n }\r\n }\r\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\r\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\r\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\r\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\r\n }\r\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\r\n if (builtin) {\r\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\r\n }\r\n const type = this.scope.findTypePoolType(name);\r\n if (type) {\r\n return type;\r\n }\r\n return undefined;\r\n }\r\n resolveLikeName(node, headerLogic = true) {\r\n var _a;\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n let chain = node.findFirstExpression(Expressions.FieldChain);\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.TypeName);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.FieldSub);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n }\r\n if (chain === undefined) {\r\n throw new Error(\"resolveLikeName, chain undefined\");\r\n }\r\n const fullName = chain.concatTokens();\r\n const children = [...chain.getChildren()];\r\n if (children.length === 0) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\r\n }\r\n let type = undefined;\r\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\r\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\r\n }\r\n else {\r\n const name = children.shift().getFirstToken().getStr();\r\n let found = this.scope.findVariable(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n if (found === undefined) {\r\n found = this.scope.findExtraLikeType(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n }\r\n if (found) {\r\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (type === undefined) {\r\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\r\n }\r\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\r\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n while (children.length > 0) {\r\n const child = children.shift();\r\n if (child.getFirstToken().getStr() === \"-\") {\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n }\r\n else if (child.concatTokens() === \"[]\") {\r\n if (type instanceof Types.TableType) {\r\n type = new basic_1.TableType(type.getRowType(), { withHeader: false });\r\n }\r\n }\r\n else { // field name\r\n let sub = undefined;\r\n if (type instanceof Types.TableType) {\r\n type = type.getRowType();\r\n }\r\n if (type instanceof Types.StructureType) {\r\n sub = type.getComponentByName(child.getFirstToken().getStr());\r\n }\r\n if (sub === undefined) {\r\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\r\n }\r\n type = sub;\r\n }\r\n }\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else if (type instanceof basic_1.TableType\r\n && type.isWithHeader()\r\n && headerLogic === true) {\r\n type = type.getRowType();\r\n }\r\n else if (type instanceof Types.TableType\r\n && type.isWithHeader() === true\r\n && type.getRowType() instanceof Types.VoidType) {\r\n return type.getRowType();\r\n }\r\n }\r\n if (!type) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\r\n }\r\n return type;\r\n }\r\n resolveTypeName(typeName, length, decimals, qualifiedName) {\r\n var _a;\r\n if (typeName === undefined) {\r\n return undefined;\r\n }\r\n let chain = this.resolveTypeChain(typeName);\r\n if (chain) {\r\n if (chain instanceof basic_1.CharacterType && qualifiedName) {\r\n chain = chain.cloneType(qualifiedName);\r\n }\r\n return chain;\r\n }\r\n const chainText = typeName.concatTokens().toUpperCase();\r\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\r\n if (f !== undefined) {\r\n return f;\r\n }\r\n const typ = this.scope.findType(chainText);\r\n if (typ) {\r\n const token = typeName.getFirstToken();\r\n if (chainText.includes(\"~\")) {\r\n const name = chainText.split(\"~\")[0];\r\n const idef = this.scope.findInterfaceDefinition(name);\r\n if (idef) {\r\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\r\n }\r\n }\r\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\r\n return typ.getType();\r\n }\r\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type) {\r\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\r\n return type;\r\n }\r\n const ddic = this.scope.getDDIC().lookup(chainText);\r\n if (ddic) {\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\r\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else if (ddic.type instanceof basic_1.VoidType) {\r\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n }\r\n return ddic.type;\r\n }\r\n return undefined;\r\n }\r\n simpleType(node, qualifiedNamePrefix) {\r\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (nameExpr === undefined) {\r\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (nameExpr === undefined) {\r\n return undefined;\r\n }\r\n let name = nameExpr.getFirstToken();\r\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\r\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\r\n }\r\n let qualifiedName = undefined;\r\n if (node.get() instanceof Statements.Type) {\r\n if (this.scope.isTypePool() === true) {\r\n qualifiedName = name.getStr();\r\n }\r\n else {\r\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\r\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\r\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\r\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\r\n }\r\n }\r\n }\r\n else if (qualifiedNamePrefix) {\r\n qualifiedName = qualifiedNamePrefix + qualifiedName;\r\n }\r\n const found = this.parseType(node, qualifiedName);\r\n if (found) {\r\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\r\n }\r\n return undefined;\r\n }\r\n parseTable(node, name) {\r\n var _a, _b, _c;\r\n const typename = node.findFirstExpression(Expressions.TypeName);\r\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n let type = undefined;\r\n if (text.startsWith(\"TYPE STANDARD TABLE \") || text.startsWith(\"LIKE STANDARD TABLE \")) {\r\n type = basic_1.TableAccessType.standard;\r\n }\r\n else if (text.startsWith(\"TYPE SORTED TABLE \") || text.startsWith(\"LIKE SORTED TABLE \")) {\r\n type = basic_1.TableAccessType.sorted;\r\n }\r\n else if (text.startsWith(\"TYPE HASHED TABLE \") || text.startsWith(\"LIKE HASHED TABLE \")) {\r\n type = basic_1.TableAccessType.hashed;\r\n }\r\n const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);\r\n const firstKey = typeTableKeys[0];\r\n const primaryKey = {\r\n name: \"primary_key\",\r\n type: type,\r\n isUnique: (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\r\n keyFields: [],\r\n };\r\n for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {\r\n primaryKey.keyFields.push(k.concatTokens().toUpperCase());\r\n }\r\n const secondaryKeys = [];\r\n for (let i = 1; i < typeTableKeys.length; i++) {\r\n const row = typeTableKeys[i];\r\n const name = (_b = row.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const secondary = {\r\n name: name,\r\n type: row.findDirectTokenByText(\"SORTED\") ? basic_1.TableAccessType.sorted : basic_1.TableAccessType.hashed,\r\n isUnique: (row === null || row === void 0 ? void 0 : row.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\r\n keyFields: [],\r\n };\r\n for (const k of (row === null || row === void 0 ? void 0 : row.findDirectExpressions(expressions_1.FieldSub)) || []) {\r\n secondary.keyFields.push(k.concatTokens().toUpperCase());\r\n }\r\n secondaryKeys.push(secondary);\r\n }\r\n const options = {\r\n withHeader: text.includes(\" WITH HEADER LINE\"),\r\n primaryKey: primaryKey,\r\n secondary: secondaryKeys,\r\n };\r\n let found = undefined;\r\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\r\n found = this.resolveTypeRef(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE TABLE OF \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\r\n found = this.resolveTypeName(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE TABLE OF \")\r\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\r\n || text.startsWith(\"LIKE SORTED TABLE OF \")\r\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\r\n found = this.resolveLikeName(node);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), options);\r\n }\r\n else if (text.startsWith(\"TYPE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ]);\r\n return new Types.TableType(structure, options, name);\r\n }\r\n else if (text.startsWith(\"LIKE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n found = this.resolveLikeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ], name);\r\n return new Types.TableType(structure, options);\r\n }\r\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\r\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\r\n const name = typename.concatTokens();\r\n const type = (_c = this.scope.getDDIC().lookupDDLS(name)) === null || _c === void 0 ? void 0 : _c.type;\r\n if (type) {\r\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\r\n return new Types.UnknownType(`DDLS ${name} not found`);\r\n }\r\n else {\r\n return new Types.VoidType(name);\r\n }\r\n }\r\n // fallback to old style syntax, OCCURS etc\r\n return this.parseType(node, name);\r\n }\r\n parseType(node, qualifiedName) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const typeName = node.findFirstExpression(Expressions.TypeName);\r\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\r\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\r\n text = \"TYPE\";\r\n }\r\n }\r\n if (text === undefined) {\r\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = \"TYPE\";\r\n }\r\n let found = undefined;\r\n if (text.startsWith(\"LIKE LINE OF \")) {\r\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n let e = node.findFirstExpression(Expressions.Type);\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n const type = this.resolveLikeName(e, false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n else if (type instanceof Types.TableType) {\r\n return type.getRowType();\r\n }\r\n else if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else {\r\n return new Types.UnknownType(\"Type error, not a table type \" + name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE REF TO \")) {\r\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n return new Types.DataReference(type, name);\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\") });\r\n }\r\n else if (text.startsWith(\"LIKE \")) {\r\n let sub = node.findFirstExpression(Expressions.Type);\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.TypeParam);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n found = this.resolveLikeName(sub);\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE LINE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\r\n found = found.getType();\r\n }\r\n if (found instanceof Types.TableType) {\r\n return found.getRowType();\r\n }\r\n else if (found instanceof Types.VoidType) {\r\n return found;\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\r\n }\r\n else {\r\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE REF TO \")) {\r\n found = this.resolveTypeRef(typeName);\r\n }\r\n else if (text.startsWith(\"TYPE\")) {\r\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\r\n const concat = node.concatTokens().toUpperCase();\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\r\n if (found instanceof Types.VoidType) {\r\n found = new Types.TableType(found, { withHeader: true });\r\n }\r\n else if (!(found instanceof Types.TableType)) {\r\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\r\n }\r\n else {\r\n found = new Types.TableType(found.getRowType(), { withHeader: true });\r\n }\r\n }\r\n if (found === undefined && typeName === undefined) {\r\n let length = 1;\r\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\r\n if (len) {\r\n const int = len.findDirectExpression(Expressions.Integer);\r\n if (int) {\r\n length = parseInt(int.concatTokens(), 10);\r\n }\r\n }\r\n found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback\r\n if (this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n }\r\n return found;\r\n }\r\n /////////////////////\r\n isOccurs(node) {\r\n var _a;\r\n if (node.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // todo, rewrite this method\r\n resolveTypeChain(expr) {\r\n var _a;\r\n const chainText = expr.concatTokens().toUpperCase();\r\n if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\r\n return undefined;\r\n }\r\n let className;\r\n let rest = chainText;\r\n if (chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n else if (chainText.includes(\"->\")) {\r\n const split = chainText.split(\"->\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n const subs = rest.split(\"-\");\r\n let foundType = undefined;\r\n if (className && chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n const className = split[0];\r\n // the prefix might be itself\r\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\r\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\r\n const foundId = this.scope.findType(subs[0]);\r\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\r\n if (foundType === undefined) {\r\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\r\n }\r\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n // lookup in local and global scope\r\n const obj = this.scope.findObjectDefinition(className);\r\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\r\n return new Types.VoidType(className);\r\n }\r\n else if (obj === undefined) {\r\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\r\n }\r\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n }\r\n else if (className && chainText.includes(\"->\")) {\r\n const varVar = this.scope.findVariable(className);\r\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\r\n if (foo instanceof basic_1.ObjectReferenceType) {\r\n const typeName = subs[0];\r\n let id = foo.getIdentifier();\r\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\r\n if (found) {\r\n id = found;\r\n }\r\n else {\r\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\r\n }\r\n }\r\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\r\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(typeName + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\r\n }\r\n }\r\n else if (foo === undefined) {\r\n return new Types.UnknownType(className + \" not found in scope\");\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\r\n }\r\n }\r\n else {\r\n const found = this.scope.findType(subs[0]);\r\n foundType = found === null || found === void 0 ? void 0 : found.getType();\r\n if (foundType === undefined) {\r\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (typePoolType) {\r\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\r\n foundType = typePoolType;\r\n }\r\n if (foundType === undefined) {\r\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\r\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n foundType = f.type.getType();\r\n }\r\n else {\r\n foundType = f.type;\r\n }\r\n }\r\n }\r\n else {\r\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(subs[0]);\r\n }\r\n else if (foundType instanceof Types.VoidType) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return foundType;\r\n }\r\n else if (foundType === undefined) {\r\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\r\n }\r\n }\r\n subs.shift();\r\n while (subs.length > 0) {\r\n if (foundType instanceof Types.UnknownType\r\n || foundType instanceof Types.VoidType) {\r\n return foundType;\r\n }\r\n else if (!(foundType instanceof Types.StructureType)) {\r\n return new Types.UnknownType(\"Not a structured type\");\r\n }\r\n foundType = foundType.getComponentByName(subs[0]);\r\n subs.shift();\r\n }\r\n return foundType;\r\n }\r\n resolveConstantValue(expr) {\r\n var _a, _b;\r\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\r\n throw new Error(\"resolveConstantValue\");\r\n }\r\n const firstNode = expr.getFirstChild();\r\n const firstToken = firstNode.getFirstToken();\r\n const firstName = firstToken.getStr();\r\n if (firstNode.get() instanceof Expressions.Field) {\r\n const found = this.scope.findVariable(firstName);\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName\r\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\r\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\r\n const children = expr.getChildren();\r\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const found = this.scope.findVariable(token.getStr());\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName) {\r\n const obj = this.scope.findObjectDefinition(firstName);\r\n if (obj === undefined) {\r\n if (this.scope.existsObject(firstName).found === true) {\r\n return undefined;\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\r\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\r\n }\r\n else {\r\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\r\n return undefined;\r\n }\r\n }\r\n const children = expr.getChildren();\r\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n const attr = token.getStr();\r\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\r\n if (c instanceof class_constant_1.ClassConstant) {\r\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n const val = c.getValue();\r\n if (typeof val === \"string\") {\r\n return val;\r\n }\r\n else if (typeof val === \"object\" && children[4]) {\r\n const name = children[4].getFirstToken().getStr();\r\n if (val[name] !== undefined) {\r\n return val[name];\r\n }\r\n }\r\n return undefined;\r\n }\r\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\r\n }\r\n else {\r\n throw new Error(\"resolveConstantValue, unexpected structure\");\r\n }\r\n }\r\n resolveTypeRef(chain) {\r\n var _a;\r\n if (chain === undefined) {\r\n return undefined;\r\n }\r\n const name = chain.getFirstToken().getStr();\r\n if (chain.getAllTokens().length === 1) {\r\n if (name.toUpperCase() === \"OBJECT\") {\r\n return new Types.GenericObjectReferenceType();\r\n }\r\n const search = this.scope.existsObject(name);\r\n if (search.found === true && search.id) {\r\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\r\n return new Types.ObjectReferenceType(search.id, name);\r\n }\r\n }\r\n const found = this.resolveTypeName(chain);\r\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\r\n return new Types.DataReference(found);\r\n }\r\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\r\n return new Types.DataReference(new Types.AnyType());\r\n }\r\n if (this.scope.isBadiDef(name) === true) {\r\n return new Types.VoidType(name);\r\n }\r\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\r\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\r\n }\r\n findValue(node) {\r\n const val = node.findFirstExpression(Expressions.Value);\r\n if (val === undefined) {\r\n throw new Error(\"VALUE missing in expression\");\r\n }\r\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\r\n return undefined;\r\n }\r\n const constant = val.findFirstExpression(Expressions.Constant);\r\n if (constant) {\r\n return constant.concatTokens();\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n return this.resolveConstantValue(chain);\r\n }\r\n throw new Error(\"findValue, unexpected\");\r\n }\r\n findDecimals(node) {\r\n var _a, _b;\r\n const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (dec) {\r\n return parseInt(dec, 10);\r\n }\r\n return undefined;\r\n }\r\n findLength(node) {\r\n const val = node.findFirstExpression(Expressions.Length);\r\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\r\n if (val && flen) {\r\n throw new Error(\"Only specify length once\");\r\n }\r\n if (flen) {\r\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\r\n if (cintExpr) {\r\n return this.parseInt(cintExpr.concatTokens());\r\n }\r\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (cchain) {\r\n const val = this.resolveConstantValue(cchain);\r\n return this.parseInt(val);\r\n }\r\n }\r\n if (val === undefined) {\r\n return 1;\r\n }\r\n const intExpr = val.findFirstExpression(Expressions.Integer);\r\n if (intExpr) {\r\n return this.parseInt(intExpr.concatTokens());\r\n }\r\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\r\n if (strExpr) {\r\n return this.parseInt(strExpr.concatTokens());\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n const val = this.resolveConstantValue(chain);\r\n return this.parseInt(val);\r\n }\r\n throw new Error(\"Unexpected, findLength\");\r\n }\r\n parseInt(text) {\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n if (text.startsWith(\"'\")) {\r\n text = text.split(\"'\")[1];\r\n }\r\n else if (text.startsWith(\"`\")) {\r\n text = text.split(\"`\")[1];\r\n }\r\n return parseInt(text, 10);\r\n }\r\n}\r\nexports.BasicTypes = BasicTypes;\r\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
|
|
6729
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BasicTypes = void 0;\r\n/* eslint-disable default-case */\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst Expressions = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Types = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst class_constant_1 = __webpack_require__(/*! ../types/class_constant */ \"./node_modules/@abaplint/core/build/src/abap/types/class_constant.js\");\r\nconst identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js\");\r\nconst _reference_1 = __webpack_require__(/*! ./_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./expressions/field_chain */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_chain.js\");\r\nconst types_1 = __webpack_require__(/*! ../types */ \"./node_modules/@abaplint/core/build/src/abap/types/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ./_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass BasicTypes {\r\n constructor(filename, scope) {\r\n this.filename = filename;\r\n this.scope = scope;\r\n }\r\n lookupQualifiedName(name) {\r\n var _a;\r\n // argh, todo, rewrite this entire method, more argh\r\n if (name === undefined) {\r\n return undefined;\r\n }\r\n const found = this.scope.findType(name);\r\n if (found) {\r\n return found;\r\n }\r\n if (name.includes(\"=>\")) {\r\n const split = name.split(\"=>\");\r\n const ooName = split[0];\r\n const typeName = split[1];\r\n const oo = this.scope.findObjectDefinition(ooName);\r\n if (oo) {\r\n if (typeName.includes(\"-\")) {\r\n const split = typeName.split(\"-\");\r\n const subTypeName = split[0];\r\n const fieldName = split[1];\r\n const stru = oo.getTypeDefinitions().getByName(subTypeName);\r\n const struType = stru === null || stru === void 0 ? void 0 : stru.getType();\r\n if (stru && struType instanceof basic_1.StructureType) {\r\n const f = struType.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);\r\n }\r\n }\r\n }\r\n else {\r\n const f = oo.getTypeDefinitions().getByName(typeName);\r\n if (f) {\r\n return f;\r\n }\r\n }\r\n }\r\n }\r\n else if (name.includes(\"-\")) {\r\n const split = name.split(\"-\");\r\n const typeName = split[0];\r\n const fieldName = split[1];\r\n const type = this.scope.findType(typeName);\r\n if (type) {\r\n const stru = type.getType();\r\n if (stru instanceof basic_1.StructureType) {\r\n const f = stru.getComponentByName(fieldName);\r\n if (f) {\r\n return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);\r\n }\r\n }\r\n }\r\n }\r\n const lookup = this.scope.getDDIC().lookupNoVoid(name);\r\n const id = (_a = lookup === null || lookup === void 0 ? void 0 : lookup.object) === null || _a === void 0 ? void 0 : _a.getIdentifier();\r\n if (id && (lookup === null || lookup === void 0 ? void 0 : lookup.type)) {\r\n return new _typed_identifier_1.TypedIdentifier(id.getToken(), id.getFilename(), lookup.type);\r\n }\r\n const builtin = this.scope.getDDIC().lookupBuiltinType(name);\r\n if (builtin) {\r\n return new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(new position_1.Position(1, 1), name), _builtin_1.BuiltIn.filename, builtin);\r\n }\r\n const type = this.scope.findTypePoolType(name);\r\n if (type) {\r\n return type;\r\n }\r\n return undefined;\r\n }\r\n resolveLikeName(node, headerLogic = true) {\r\n var _a;\r\n if (node === undefined) {\r\n return undefined;\r\n }\r\n let chain = node.findFirstExpression(Expressions.FieldChain);\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.TypeName);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.FieldSub);\r\n }\r\n if (chain === undefined) {\r\n chain = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n }\r\n if (chain === undefined) {\r\n throw new Error(\"resolveLikeName, chain undefined\");\r\n }\r\n const fullName = chain.concatTokens();\r\n const children = [...chain.getChildren()];\r\n if (children.length === 0) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName1\");\r\n }\r\n let type = undefined;\r\n if (children[1] && (children[1].getFirstToken().getStr() === \"=>\" || children[1].getFirstToken().getStr() === \"->\")) {\r\n type = new field_chain_1.FieldChain().runSyntax(chain, this.scope, this.filename, _reference_1.ReferenceType.TypeReference);\r\n }\r\n else {\r\n const name = children.shift().getFirstToken().getStr();\r\n let found = this.scope.findVariable(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n if (found === undefined) {\r\n found = this.scope.findExtraLikeType(name);\r\n type = found === null || found === void 0 ? void 0 : found.getType();\r\n }\r\n if (found) {\r\n this.scope.addReference(chain === null || chain === void 0 ? void 0 : chain.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (type === undefined) {\r\n type = (_a = this.scope.getDDIC().lookupNoVoid(name)) === null || _a === void 0 ? void 0 : _a.type;\r\n }\r\n if (type === undefined && this.scope.isOO() === false && this.scope.getDDIC().inErrorNamespace(name) === false) {\r\n this.scope.addReference(chain.getChildren()[0].getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n while (children.length > 0) {\r\n const child = children.shift();\r\n if (child.getFirstToken().getStr() === \"-\") {\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n }\r\n else if (child.concatTokens() === \"[]\") {\r\n if (type instanceof Types.TableType) {\r\n type = new basic_1.TableType(type.getRowType(), { withHeader: false });\r\n }\r\n }\r\n else { // field name\r\n let sub = undefined;\r\n if (type instanceof Types.TableType) {\r\n type = type.getRowType();\r\n }\r\n if (type instanceof Types.StructureType) {\r\n sub = type.getComponentByName(child.getFirstToken().getStr());\r\n }\r\n if (sub === undefined) {\r\n return new Types.UnknownType(\"Type error, field not part of structure \" + fullName);\r\n }\r\n type = sub;\r\n }\r\n }\r\n if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else if (type instanceof basic_1.TableType\r\n && type.isWithHeader()\r\n && headerLogic === true) {\r\n type = type.getRowType();\r\n }\r\n else if (type instanceof Types.TableType\r\n && type.isWithHeader() === true\r\n && type.getRowType() instanceof Types.VoidType) {\r\n return type.getRowType();\r\n }\r\n }\r\n if (!type) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + fullName + \"\\\", resolveLikeName2\");\r\n }\r\n return type;\r\n }\r\n resolveTypeName(typeName, length, decimals, qualifiedName) {\r\n var _a;\r\n if (typeName === undefined) {\r\n return undefined;\r\n }\r\n let chain = this.resolveTypeChain(typeName);\r\n if (chain) {\r\n if (chain instanceof basic_1.CharacterType && qualifiedName) {\r\n chain = chain.cloneType(qualifiedName);\r\n }\r\n return chain;\r\n }\r\n const chainText = typeName.concatTokens().toUpperCase();\r\n const f = this.scope.getDDIC().lookupBuiltinType(chainText, length, decimals, qualifiedName);\r\n if (f !== undefined) {\r\n return f;\r\n }\r\n const typ = this.scope.findType(chainText);\r\n if (typ) {\r\n const token = typeName.getFirstToken();\r\n if (chainText.includes(\"~\")) {\r\n const name = chainText.split(\"~\")[0];\r\n const idef = this.scope.findInterfaceDefinition(name);\r\n if (idef) {\r\n this.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: \"INTF\", ooName: name });\r\n }\r\n }\r\n this.scope.addReference(token, typ, _reference_1.ReferenceType.TypeReference, this.filename);\r\n return typ.getType();\r\n }\r\n const type = (_a = this.scope.findTypePoolType(chainText)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type) {\r\n // this.scope.addReference(typeName.getFirstToken(), type, ReferenceType.TypeReference, this.filename);\r\n return type;\r\n }\r\n const ddic = this.scope.getDDIC().lookup(chainText);\r\n if (ddic) {\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: ddic.object, token: typeName.getFirstToken(), filename: this.filename });\r\n if (ddic.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n this.scope.addReference(typeName.getFirstToken(), ddic.type, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else if (ddic.type instanceof basic_1.VoidType) {\r\n this.scope.addReference(typeName.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n }\r\n return ddic.type;\r\n }\r\n return undefined;\r\n }\r\n simpleType(node, qualifiedNamePrefix) {\r\n let nameExpr = node.findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (nameExpr === undefined) {\r\n nameExpr = node.findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (nameExpr === undefined) {\r\n return undefined;\r\n }\r\n let name = nameExpr.getFirstToken();\r\n if (nameExpr.countTokens() > 1) { // workaround for names with dashes\r\n name = new identifier_1.Identifier(name.getStart(), nameExpr.concatTokens());\r\n }\r\n let qualifiedName = undefined;\r\n if (node.get() instanceof Statements.Type) {\r\n if (this.scope.isTypePool() === true) {\r\n qualifiedName = name.getStr();\r\n }\r\n else {\r\n qualifiedName = (qualifiedNamePrefix || \"\") + name.getStr();\r\n if (this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition\r\n || this.scope.getType() === _scope_type_1.ScopeType.Interface) {\r\n qualifiedName = this.scope.getName() + \"=>\" + qualifiedName;\r\n }\r\n }\r\n }\r\n else if (qualifiedNamePrefix) {\r\n qualifiedName = qualifiedNamePrefix + qualifiedName;\r\n }\r\n const found = this.parseType(node, qualifiedName);\r\n if (found) {\r\n return new _typed_identifier_1.TypedIdentifier(name, this.filename, found);\r\n }\r\n return undefined;\r\n }\r\n parseTable(node, name) {\r\n var _a, _b, _c;\r\n const typename = node.findFirstExpression(Expressions.TypeName);\r\n const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n let type = undefined;\r\n if (text.startsWith(\"TYPE STANDARD TABLE \") || text.startsWith(\"LIKE STANDARD TABLE \")) {\r\n type = basic_1.TableAccessType.standard;\r\n }\r\n else if (text.startsWith(\"TYPE SORTED TABLE \") || text.startsWith(\"LIKE SORTED TABLE \")) {\r\n type = basic_1.TableAccessType.sorted;\r\n }\r\n else if (text.startsWith(\"TYPE HASHED TABLE \") || text.startsWith(\"LIKE HASHED TABLE \")) {\r\n type = basic_1.TableAccessType.hashed;\r\n }\r\n const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);\r\n const firstKey = typeTableKeys[0];\r\n const primaryKey = {\r\n name: \"primary_key\",\r\n type: type,\r\n isUnique: (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\r\n keyFields: [],\r\n };\r\n for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {\r\n primaryKey.keyFields.push(k.concatTokens().toUpperCase());\r\n }\r\n const secondaryKeys = [];\r\n for (let i = 1; i < typeTableKeys.length; i++) {\r\n const row = typeTableKeys[i];\r\n const name = (_b = row.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const secondary = {\r\n name: name,\r\n type: row.findDirectTokenByText(\"SORTED\") ? basic_1.TableAccessType.sorted : basic_1.TableAccessType.hashed,\r\n isUnique: (row === null || row === void 0 ? void 0 : row.concatTokens().toUpperCase().includes(\"WITH UNIQUE \")) === true,\r\n keyFields: [],\r\n };\r\n for (const k of (row === null || row === void 0 ? void 0 : row.findDirectExpressions(expressions_1.FieldSub)) || []) {\r\n secondary.keyFields.push(k.concatTokens().toUpperCase());\r\n }\r\n secondaryKeys.push(secondary);\r\n }\r\n const options = {\r\n withHeader: text.includes(\" WITH HEADER LINE\"),\r\n primaryKey: primaryKey,\r\n secondary: secondaryKeys,\r\n };\r\n let found = undefined;\r\n if (text.startsWith(\"TYPE TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF REF TO \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF REF TO \")) {\r\n found = this.resolveTypeRef(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE TABLE OF \")\r\n || text.startsWith(\"TYPE STANDARD TABLE OF \")\r\n || text.startsWith(\"TYPE SORTED TABLE OF \")\r\n || text.startsWith(\"TYPE HASHED TABLE OF \")) {\r\n found = this.resolveTypeName(typename);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE TABLE OF \")\r\n || text.startsWith(\"LIKE STANDARD TABLE OF \")\r\n || text.startsWith(\"LIKE SORTED TABLE OF \")\r\n || text.startsWith(\"LIKE HASHED TABLE OF \")) {\r\n found = this.resolveLikeName(node);\r\n if (found) {\r\n return new Types.TableType(found, options, name);\r\n }\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), options);\r\n }\r\n else if (text.startsWith(\"TYPE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"TYPE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ]);\r\n return new Types.TableType(structure, options, name);\r\n }\r\n else if (text.startsWith(\"LIKE RANGE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.SimpleFieldChain);\r\n found = this.resolveLikeName(sub);\r\n if (found === undefined) {\r\n return new Types.UnknownType(\"LIKE RANGE OF, could not resolve type\");\r\n }\r\n const structure = new Types.StructureType([\r\n { name: \"sign\", type: new Types.CharacterType(1) },\r\n { name: \"option\", type: new Types.CharacterType(2) },\r\n { name: \"low\", type: found },\r\n { name: \"high\", type: found },\r\n ], name);\r\n return new Types.TableType(structure, options);\r\n }\r\n else if (typename && (text.startsWith(\"TYPE TABLE FOR CREATE \")\r\n || text.startsWith(\"TYPE TABLE FOR UPDATE \"))) {\r\n const name = typename.concatTokens();\r\n const type = (_c = this.scope.getDDIC().lookupDDLS(name)) === null || _c === void 0 ? void 0 : _c.type;\r\n if (type) {\r\n return new Types.TableType(new basic_1.VoidType(\"RapTodo\"), options);\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(name)) {\r\n return new Types.UnknownType(`DDLS ${name} not found`);\r\n }\r\n else {\r\n return new Types.VoidType(name);\r\n }\r\n }\r\n // fallback to old style syntax, OCCURS etc\r\n return this.parseType(node, name);\r\n }\r\n parseType(node, qualifiedName) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const typeName = node.findFirstExpression(Expressions.TypeName);\r\n let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n text = (_b = node.findFirstExpression(Expressions.TypeParam)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = (_c = node.findFirstExpression(Expressions.TypeTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();\r\n if ((text === null || text === void 0 ? void 0 : text.startsWith(\"TYPE\")) === false && (text === null || text === void 0 ? void 0 : text.startsWith(\"LIKE\")) === false) {\r\n text = \"TYPE\";\r\n }\r\n }\r\n if (text === undefined) {\r\n text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();\r\n }\r\n if (text === undefined) {\r\n text = \"TYPE\";\r\n }\r\n let found = undefined;\r\n if (text.startsWith(\"LIKE LINE OF \")) {\r\n const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n let e = node.findFirstExpression(Expressions.Type);\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (e === undefined) {\r\n e = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n const type = this.resolveLikeName(e, false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n else if (type instanceof Types.TableType) {\r\n return type.getRowType();\r\n }\r\n else if (type instanceof Types.VoidType) {\r\n return type;\r\n }\r\n else {\r\n return new Types.UnknownType(\"Type error, not a table type \" + name);\r\n }\r\n }\r\n else if (text.startsWith(\"LIKE REF TO \")) {\r\n const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);\r\n if (type === undefined) {\r\n return new Types.UnknownType(\"Type error, could not resolve \\\"\" + name + \"\\\", parseType\");\r\n }\r\n return new Types.DataReference(type, name);\r\n }\r\n else if (text === \"TYPE STANDARD TABLE\"\r\n || text === \"TYPE SORTED TABLE\"\r\n || text === \"TYPE HASHED TABLE\"\r\n || text === \"TYPE INDEX TABLE\"\r\n || text === \"TYPE ANY TABLE\") {\r\n return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\") });\r\n }\r\n else if (text.startsWith(\"LIKE \")) {\r\n let sub = node.findFirstExpression(Expressions.Type);\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FormParamType);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.TypeParam);\r\n }\r\n if (sub === undefined) {\r\n sub = node.findFirstExpression(Expressions.FieldChain);\r\n }\r\n found = this.resolveLikeName(sub);\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: text.includes(\"WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE LINE OF \")) {\r\n const sub = node.findFirstExpression(Expressions.TypeName);\r\n found = this.resolveTypeName(sub);\r\n if (found instanceof _typed_identifier_1.TypedIdentifier) {\r\n found = found.getType();\r\n }\r\n if (found instanceof Types.TableType) {\r\n return found.getRowType();\r\n }\r\n else if (found instanceof Types.VoidType) {\r\n return found;\r\n }\r\n else if (found instanceof Types.UnknownType) {\r\n return new Types.UnknownType(\"TYPE LINE OF, unknown type, \" + found.getError());\r\n }\r\n else {\r\n return new Types.UnknownType(\"TYPE LINE OF, unexpected type, \" + (found === null || found === void 0 ? void 0 : found.constructor.name));\r\n }\r\n }\r\n else if (text.startsWith(\"TYPE REF TO \")) {\r\n found = this.resolveTypeRef(typeName);\r\n }\r\n else if (text.startsWith(\"TYPE\")) {\r\n found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);\r\n const concat = node.concatTokens().toUpperCase();\r\n if (found && this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n else if (found && concat.includes(\" WITH HEADER LINE\")) {\r\n if (found instanceof Types.VoidType) {\r\n found = new Types.TableType(found, { withHeader: true });\r\n }\r\n else if (!(found instanceof Types.TableType)) {\r\n throw new Error(\"WITH HEADER LINE can only be used with internal table\");\r\n }\r\n else {\r\n found = new Types.TableType(found.getRowType(), { withHeader: true });\r\n }\r\n }\r\n if (found === undefined && typeName === undefined) {\r\n let length = 1;\r\n const len = node.findDirectExpression(Expressions.ConstantFieldLength);\r\n if (len) {\r\n const int = len.findDirectExpression(Expressions.Integer);\r\n if (int) {\r\n length = parseInt(int.concatTokens(), 10);\r\n }\r\n }\r\n found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback\r\n if (this.isOccurs(node)) {\r\n found = new Types.TableType(found, { withHeader: concat.includes(\" WITH HEADER LINE\") }, qualifiedName);\r\n }\r\n }\r\n }\r\n return found;\r\n }\r\n /////////////////////\r\n isOccurs(node) {\r\n var _a;\r\n if (node.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n else if ((_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText(\"OCCURS\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // todo, rewrite this method\r\n resolveTypeChain(expr) {\r\n var _a;\r\n const chainText = expr.concatTokens().toUpperCase();\r\n if (chainText.includes(\"=>\") === false && chainText.includes(\"-\") === false) {\r\n return undefined;\r\n }\r\n let className;\r\n let rest = chainText;\r\n if (chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n else if (chainText.includes(\"->\")) {\r\n const split = chainText.split(\"->\");\r\n className = split[0];\r\n rest = split[1];\r\n }\r\n const subs = rest.split(\"-\");\r\n let foundType = undefined;\r\n if (className && chainText.includes(\"=>\")) {\r\n const split = chainText.split(\"=>\");\r\n const className = split[0];\r\n // the prefix might be itself\r\n if ((this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)\r\n && this.scope.getName().toUpperCase() === className.toUpperCase()) {\r\n const foundId = this.scope.findType(subs[0]);\r\n foundType = foundId === null || foundId === void 0 ? void 0 : foundId.getType();\r\n if (foundType === undefined) {\r\n return new Types.UnknownType(\"Could not resolve type \" + chainText);\r\n }\r\n this.scope.addReference(expr.getTokens()[2], foundId, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n // lookup in local and global scope\r\n const obj = this.scope.findObjectDefinition(className);\r\n if (obj === undefined && this.scope.getDDIC().inErrorNamespace(className) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: className.toUpperCase() });\r\n return new Types.VoidType(className);\r\n }\r\n else if (obj === undefined) {\r\n return new Types.UnknownType(\"Could not resolve top \" + className + \", resolveTypeChain\");\r\n }\r\n const type = obj instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), obj, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: className });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(obj, subs[0]);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(subs[0] + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n }\r\n else if (className && chainText.includes(\"->\")) {\r\n const varVar = this.scope.findVariable(className);\r\n const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();\r\n if (foo instanceof basic_1.ObjectReferenceType) {\r\n const typeName = subs[0];\r\n let id = foo.getIdentifier();\r\n if (!(id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition)) {\r\n const found = this.scope.findObjectDefinition(foo.getIdentifierName());\r\n if (found) {\r\n id = found;\r\n }\r\n else {\r\n return new Types.UnknownType(foo.getIdentifierName() + \" not found in scope\");\r\n }\r\n }\r\n if (id instanceof types_1.ClassDefinition || id instanceof types_1.InterfaceDefinition) {\r\n const type = id instanceof types_1.ClassDefinition ? \"CLAS\" : \"INTF\";\r\n this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });\r\n const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);\r\n foundType = byName === null || byName === void 0 ? void 0 : byName.getType();\r\n if (byName === undefined || foundType === undefined) {\r\n return new Types.UnknownType(typeName + \" not found in class or interface\");\r\n }\r\n this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + id.constructor.name);\r\n }\r\n }\r\n else if (foo === undefined) {\r\n return new Types.UnknownType(className + \" not found in scope\");\r\n }\r\n else {\r\n return new Types.UnknownType(\"Not an object reference, \" + className + \", \" + foo.constructor.name);\r\n }\r\n }\r\n else {\r\n const found = this.scope.findType(subs[0]);\r\n foundType = found === null || found === void 0 ? void 0 : found.getType();\r\n if (foundType === undefined) {\r\n const typePoolType = (_a = this.scope.findTypePoolType(subs[0])) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (typePoolType) {\r\n // this.scope.addReference(typeName.getFirstToken(), typePoolType, ReferenceType.TypeReference, this.filename);\r\n foundType = typePoolType;\r\n }\r\n if (foundType === undefined) {\r\n const f = this.scope.getDDIC().lookupTableOrView(subs[0]);\r\n this.scope.getDDICReferences().addUsing(this.scope.getParentObj(), { object: f.object, filename: this.filename, token: expr.getFirstToken() });\r\n if (f.type instanceof _typed_identifier_1.TypedIdentifier) {\r\n foundType = f.type.getType();\r\n }\r\n else {\r\n foundType = f.type;\r\n }\r\n }\r\n }\r\n else {\r\n this.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.TypeReference, this.filename);\r\n }\r\n if (foundType === undefined && this.scope.getDDIC().inErrorNamespace(subs[0]) === false) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(subs[0]);\r\n }\r\n else if (foundType instanceof Types.VoidType) {\r\n this.scope.addReference(expr.getFirstToken(), undefined, _reference_1.ReferenceType.VoidType, this.filename);\r\n return foundType;\r\n }\r\n else if (foundType === undefined) {\r\n return new Types.UnknownType(\"Unknown type \" + subs[0]);\r\n }\r\n }\r\n subs.shift();\r\n while (subs.length > 0) {\r\n if (foundType instanceof Types.UnknownType\r\n || foundType instanceof Types.VoidType) {\r\n return foundType;\r\n }\r\n else if (!(foundType instanceof Types.StructureType)) {\r\n return new Types.UnknownType(\"Not a structured type\");\r\n }\r\n foundType = foundType.getComponentByName(subs[0]);\r\n subs.shift();\r\n }\r\n return foundType;\r\n }\r\n resolveConstantValue(expr) {\r\n var _a, _b;\r\n // todo: rewrite this method\r\n if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {\r\n throw new Error(\"resolveConstantValue\");\r\n }\r\n const firstNode = expr.getFirstChild();\r\n const firstToken = firstNode.getFirstToken();\r\n const firstName = firstToken.getStr();\r\n if (firstNode.get() instanceof Expressions.Field) {\r\n const found = this.scope.findVariable(firstName);\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n else if ((found === null || found === void 0 ? void 0 : found.getType()) instanceof basic_1.StructureType) {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName\r\n && firstName.toLowerCase() === this.scope.getName().toLowerCase()\r\n && (this.scope.getType() === _scope_type_1.ScopeType.Interface\r\n || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {\r\n const children = expr.getChildren();\r\n const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const found = this.scope.findVariable(token.getStr());\r\n const val = found === null || found === void 0 ? void 0 : found.getValue();\r\n if (typeof val === \"string\") {\r\n this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n return val;\r\n }\r\n return undefined;\r\n }\r\n else if (firstNode.get() instanceof Expressions.ClassName) {\r\n const obj = this.scope.findObjectDefinition(firstName);\r\n if (obj === undefined) {\r\n if (this.scope.existsObject(firstName).found === true) {\r\n return undefined;\r\n }\r\n else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {\r\n throw new Error(\"resolveConstantValue, not found: \" + firstName);\r\n }\r\n else {\r\n this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });\r\n return undefined;\r\n }\r\n }\r\n const children = expr.getChildren();\r\n const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n const attr = token.getStr();\r\n const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);\r\n if (c instanceof class_constant_1.ClassConstant) {\r\n this.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.filename);\r\n const val = c.getValue();\r\n if (typeof val === \"string\") {\r\n return val;\r\n }\r\n else if (typeof val === \"object\" && children[4]) {\r\n const name = children[4].getFirstToken().getStr();\r\n if (val[name] !== undefined) {\r\n return val[name];\r\n }\r\n }\r\n return undefined;\r\n }\r\n throw new Error(\"resolveConstantValue, constant not found \" + attr);\r\n }\r\n else {\r\n throw new Error(\"resolveConstantValue, unexpected structure\");\r\n }\r\n }\r\n resolveTypeRef(chain) {\r\n var _a;\r\n if (chain === undefined) {\r\n return undefined;\r\n }\r\n const name = chain.getFirstToken().getStr();\r\n if (chain.getAllTokens().length === 1) {\r\n if (name.toUpperCase() === \"OBJECT\") {\r\n return new Types.GenericObjectReferenceType();\r\n }\r\n const search = this.scope.existsObject(name);\r\n if (search.found === true && search.id) {\r\n this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });\r\n return new Types.ObjectReferenceType(search.id, name);\r\n }\r\n }\r\n const found = this.resolveTypeName(chain);\r\n if (found && !(found instanceof Types.UnknownType) && !(found instanceof Types.VoidType)) {\r\n return new Types.DataReference(found);\r\n }\r\n else if (chain.concatTokens().toUpperCase() === \"DATA\") {\r\n return new Types.DataReference(new Types.AnyType());\r\n }\r\n if (this.scope.isBadiDef(name) === true) {\r\n return new Types.VoidType(name);\r\n }\r\n if (((_a = this.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.inErrorNamespace(name)) === false) {\r\n // this.scope.addReference(chain.getFirstToken(), undefined, ReferenceType.VoidType, this.filename);\r\n return new Types.VoidType(name);\r\n }\r\n return new Types.UnknownType(\"REF, unable to resolve \" + name);\r\n }\r\n findValue(node) {\r\n const val = node.findFirstExpression(Expressions.Value);\r\n if (val === undefined) {\r\n throw new Error(\"VALUE missing in expression\");\r\n }\r\n if (val.concatTokens().toUpperCase() === \"VALUE IS INITIAL\") {\r\n return undefined;\r\n }\r\n const constant = val.findFirstExpression(Expressions.Constant);\r\n if (constant) {\r\n return constant.concatTokens();\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n return this.resolveConstantValue(chain);\r\n }\r\n throw new Error(\"findValue, unexpected\");\r\n }\r\n findDecimals(node) {\r\n var _a, _b;\r\n const dec = (_b = (_a = node.findDirectExpression(Expressions.Decimals)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Integer)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (dec) {\r\n return parseInt(dec, 10);\r\n }\r\n return undefined;\r\n }\r\n findLength(node) {\r\n const val = node.findFirstExpression(Expressions.Length);\r\n const flen = node.findFirstExpression(Expressions.ConstantFieldLength);\r\n if (val && flen) {\r\n throw new Error(\"Only specify length once\");\r\n }\r\n if (flen) {\r\n const cintExpr = flen.findFirstExpression(Expressions.Integer);\r\n if (cintExpr) {\r\n return this.parseInt(cintExpr.concatTokens());\r\n }\r\n const cchain = flen.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (cchain) {\r\n const val = this.resolveConstantValue(cchain);\r\n return this.parseInt(val);\r\n }\r\n }\r\n if (val === undefined) {\r\n return 1;\r\n }\r\n const intExpr = val.findFirstExpression(Expressions.Integer);\r\n if (intExpr) {\r\n return this.parseInt(intExpr.concatTokens());\r\n }\r\n const strExpr = val.findFirstExpression(Expressions.ConstantString);\r\n if (strExpr) {\r\n return this.parseInt(strExpr.concatTokens());\r\n }\r\n const chain = val.findFirstExpression(Expressions.SimpleFieldChain);\r\n if (chain) {\r\n const val = this.resolveConstantValue(chain);\r\n return this.parseInt(val);\r\n }\r\n throw new Error(\"Unexpected, findLength\");\r\n }\r\n parseInt(text) {\r\n if (text === undefined) {\r\n return undefined;\r\n }\r\n if (text.startsWith(\"'\")) {\r\n text = text.split(\"'\")[1];\r\n }\r\n else if (text.startsWith(\"`\")) {\r\n text = text.split(\"`\")[1];\r\n }\r\n return parseInt(text, 10);\r\n }\r\n}\r\nexports.BasicTypes = BasicTypes;\r\n//# sourceMappingURL=basic_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js?");
|
|
6730
6730
|
|
|
6731
6731
|
/***/ }),
|
|
6732
6732
|
|
|
@@ -7111,7 +7111,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7111
7111
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7112
7112
|
|
|
7113
7113
|
"use strict";
|
|
7114
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallBody = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst method_parameters_1 = __webpack_require__(/*! ./method_parameters */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nclass MethodCallBody {\r\n runSyntax(node, scope, filename, method) {\r\n const parameters = node.findDirectExpression(Expressions.MethodParameters);\r\n if (parameters) {\r\n new method_parameters_1.MethodParameters().runSyntax(parameters, scope, method, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n}\r\nexports.MethodCallBody = MethodCallBody;\r\n//# sourceMappingURL=method_call_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_body.js?");
|
|
7114
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallBody = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst method_parameters_1 = __webpack_require__(/*! ./method_parameters */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst method_call_param_1 = __webpack_require__(/*! ./method_call_param */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_param.js\");\r\nclass MethodCallBody {\r\n runSyntax(node, scope, filename, method) {\r\n const parameters = node.findDirectExpression(Expressions.MethodParameters);\r\n if (parameters) {\r\n new method_parameters_1.MethodParameters().runSyntax(parameters, scope, method, filename);\r\n }\r\n const param = node.findDirectExpression(Expressions.MethodCallParam);\r\n if (param) {\r\n new method_call_param_1.MethodCallParam().runSyntax(param, scope, method, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n}\r\nexports.MethodCallBody = MethodCallBody;\r\n//# sourceMappingURL=method_call_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_body.js?");
|
|
7115
7115
|
|
|
7116
7116
|
/***/ }),
|
|
7117
7117
|
|
|
@@ -8149,6 +8149,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8149
8149
|
|
|
8150
8150
|
/***/ }),
|
|
8151
8151
|
|
|
8152
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_internal.js":
|
|
8153
|
+
/*!*******************************************************************************************!*\
|
|
8154
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_internal.js ***!
|
|
8155
|
+
\*******************************************************************************************/
|
|
8156
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8157
|
+
|
|
8158
|
+
"use strict";
|
|
8159
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyInternal = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js\");\r\nconst component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js\");\r\nclass ModifyInternal {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Target)) {\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n const target = node.findDirectExpression(Expressions.FSTarget);\r\n if (target) {\r\n new fstarget_1.FSTarget().runSyntax(target, scope, filename, undefined);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {\r\n new component_cond_1.ComponentCond().runSyntax(t, scope, filename);\r\n }\r\n }\r\n}\r\nexports.ModifyInternal = ModifyInternal;\r\n//# sourceMappingURL=modify_internal.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_internal.js?");
|
|
8160
|
+
|
|
8161
|
+
/***/ }),
|
|
8162
|
+
|
|
8152
8163
|
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_screen.js":
|
|
8153
8164
|
/*!*****************************************************************************************!*\
|
|
8154
8165
|
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_screen.js ***!
|
|
@@ -8336,6 +8347,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8336
8347
|
|
|
8337
8348
|
/***/ }),
|
|
8338
8349
|
|
|
8350
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/search.js":
|
|
8351
|
+
/*!**********************************************************************************!*\
|
|
8352
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/search.js ***!
|
|
8353
|
+
\**********************************************************************************/
|
|
8354
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8355
|
+
|
|
8356
|
+
"use strict";
|
|
8357
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Search = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nclass Search {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Search = Search;\r\n//# sourceMappingURL=search.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/search.js?");
|
|
8358
|
+
|
|
8359
|
+
/***/ }),
|
|
8360
|
+
|
|
8339
8361
|
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select.js":
|
|
8340
8362
|
/*!**********************************************************************************!*\
|
|
8341
8363
|
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select.js ***!
|
|
@@ -8567,6 +8589,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8567
8589
|
|
|
8568
8590
|
/***/ }),
|
|
8569
8591
|
|
|
8592
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/translate.js":
|
|
8593
|
+
/*!*************************************************************************************!*\
|
|
8594
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/translate.js ***!
|
|
8595
|
+
\*************************************************************************************/
|
|
8596
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8597
|
+
|
|
8598
|
+
"use strict";
|
|
8599
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Translate = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst source_1 = __webpack_require__(/*! ../expressions/source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nclass Translate {\r\n runSyntax(node, scope, filename) {\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const t of node.findDirectExpressions(Expressions.Target)) {\r\n new target_1.Target().runSyntax(t, scope, filename);\r\n }\r\n }\r\n}\r\nexports.Translate = Translate;\r\n//# sourceMappingURL=translate.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/translate.js?");
|
|
8600
|
+
|
|
8601
|
+
/***/ }),
|
|
8602
|
+
|
|
8570
8603
|
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/truncate_dataset.js":
|
|
8571
8604
|
/*!********************************************************************************************!*\
|
|
8572
8605
|
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/truncate_dataset.js ***!
|
|
@@ -8772,7 +8805,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8772
8805
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8773
8806
|
|
|
8774
8807
|
"use strict";
|
|
8775
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyntaxLogic = void 0;\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _current_scope_1 = __webpack_require__(/*! ./_current_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst _procedural_1 = __webpack_require__(/*! ./_procedural */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_procedural.js\");\r\nconst objects_1 = __webpack_require__(/*! ../../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst data_1 = __webpack_require__(/*! ./structures/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/data.js\");\r\nconst type_enum_1 = __webpack_require__(/*! ./structures/type_enum */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/type_enum.js\");\r\nconst types_1 = __webpack_require__(/*! ./structures/types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/types.js\");\r\nconst statics_1 = __webpack_require__(/*! ./structures/statics */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/statics.js\");\r\nconst constants_1 = __webpack_require__(/*! ./structures/constants */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js\");\r\nconst class_definition_1 = __webpack_require__(/*! ../types/class_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/class_definition.js\");\r\nconst interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/interface_definition.js\");\r\nconst perform_1 = __webpack_require__(/*! ./statements/perform */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/perform.js\");\r\nconst type_1 = __webpack_require__(/*! ./statements/type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/type.js\");\r\nconst constant_1 = __webpack_require__(/*! ./statements/constant */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/constant.js\");\r\nconst static_1 = __webpack_require__(/*! ./statements/static */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/static.js\");\r\nconst data_2 = __webpack_require__(/*! ./statements/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/data.js\");\r\nconst parameter_1 = __webpack_require__(/*! ./statements/parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/parameter.js\");\r\nconst fieldsymbol_1 = __webpack_require__(/*! ./statements/fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/fieldsymbol.js\");\r\nconst tables_1 = __webpack_require__(/*! ./statements/tables */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/tables.js\");\r\nconst selectoption_1 = __webpack_require__(/*! ./statements/selectoption */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selectoption.js\");\r\nconst interface_deferred_1 = __webpack_require__(/*! ./statements/interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/interface_deferred.js\");\r\nconst class_deferred_1 = __webpack_require__(/*! ./statements/class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_deferred.js\");\r\nconst call_1 = __webpack_require__(/*! ./statements/call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call.js\");\r\nconst class_implementation_1 = __webpack_require__(/*! ./statements/class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_implementation.js\");\r\nconst method_implementation_1 = __webpack_require__(/*! ./statements/method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/method_implementation.js\");\r\nconst move_1 = __webpack_require__(/*! ./statements/move */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js\");\r\nconst move_corresponding_1 = __webpack_require__(/*! ./statements/move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move_corresponding.js\");\r\nconst catch_1 = __webpack_require__(/*! ./statements/catch */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/catch.js\");\r\nconst loop_1 = __webpack_require__(/*! ./statements/loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop.js\");\r\nconst read_table_1 = __webpack_require__(/*! ./statements/read_table */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js\");\r\nconst select_1 = __webpack_require__(/*! ./statements/select */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select.js\");\r\nconst insert_internal_1 = __webpack_require__(/*! ./statements/insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_internal.js\");\r\nconst split_1 = __webpack_require__(/*! ./statements/split */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/split.js\");\r\nconst assign_1 = __webpack_require__(/*! ./statements/assign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assign.js\");\r\nconst convert_1 = __webpack_require__(/*! ./statements/convert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/convert.js\");\r\nconst describe_1 = __webpack_require__(/*! ./statements/describe */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/describe.js\");\r\nconst find_1 = __webpack_require__(/*! ./statements/find */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/find.js\");\r\nconst message_1 = __webpack_require__(/*! ./statements/message */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/message.js\");\r\nconst get_time_1 = __webpack_require__(/*! ./statements/get_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_time.js\");\r\nconst get_parameter_1 = __webpack_require__(/*! ./statements/get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_parameter.js\");\r\nconst when_type_1 = __webpack_require__(/*! ./statements/when_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when_type.js\");\r\nconst if_1 = __webpack_require__(/*! ./statements/if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/if.js\");\r\nconst else_if_1 = __webpack_require__(/*! ./statements/else_if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/else_if.js\");\r\nconst append_1 = __webpack_require__(/*! ./statements/append */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/append.js\");\r\nconst selection_screen_1 = __webpack_require__(/*! ./statements/selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selection_screen.js\");\r\nconst ranges_1 = __webpack_require__(/*! ./statements/ranges */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/ranges.js\");\r\nconst write_1 = __webpack_require__(/*! ./statements/write */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js\");\r\nconst case_1 = __webpack_require__(/*! ./statements/case */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/case.js\");\r\nconst create_object_1 = __webpack_require__(/*! ./statements/create_object */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js\");\r\nconst do_1 = __webpack_require__(/*! ./statements/do */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/do.js\");\r\nconst concatenate_1 = __webpack_require__(/*! ./statements/concatenate */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/concatenate.js\");\r\nconst call_function_1 = __webpack_require__(/*! ./statements/call_function */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_function.js\");\r\nconst clear_1 = __webpack_require__(/*! ./statements/clear */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/clear.js\");\r\nconst replace_1 = __webpack_require__(/*! ./statements/replace */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/replace.js\");\r\nconst get_bit_1 = __webpack_require__(/*! ./statements/get_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_bit.js\");\r\nconst raise_1 = __webpack_require__(/*! ./statements/raise */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise.js\");\r\nconst delete_internal_1 = __webpack_require__(/*! ./statements/delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_internal.js\");\r\nconst receive_1 = __webpack_require__(/*! ./statements/receive */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/receive.js\");\r\nconst when_1 = __webpack_require__(/*! ./statements/when */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when.js\");\r\nconst create_data_1 = __webpack_require__(/*! ./statements/create_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_data.js\");\r\nconst call_transformation_1 = __webpack_require__(/*! ./statements/call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transformation.js\");\r\nconst get_locale_1 = __webpack_require__(/*! ./statements/get_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_locale.js\");\r\nconst set_locale_1 = __webpack_require__(/*! ./statements/set_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_locale.js\");\r\nconst sort_1 = __webpack_require__(/*! ./statements/sort */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/sort.js\");\r\nconst read_report_1 = __webpack_require__(/*! ./statements/read_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_report.js\");\r\nconst authority_check_1 = __webpack_require__(/*! ./statements/authority_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/authority_check.js\");\r\nconst insert_report_1 = __webpack_require__(/*! ./statements/insert_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_report.js\");\r\nconst get_reference_1 = __webpack_require__(/*! ./statements/get_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_reference.js\");\r\nconst insert_database_1 = __webpack_require__(/*! ./statements/insert_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_database.js\");\r\nconst delete_database_1 = __webpack_require__(/*! ./statements/delete_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_database.js\");\r\nconst import_dynpro_1 = __webpack_require__(/*! ./statements/import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import_dynpro.js\");\r\nconst syntax_check_1 = __webpack_require__(/*! ./statements/syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/syntax_check.js\");\r\nconst import_1 = __webpack_require__(/*! ./statements/import */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import.js\");\r\nconst export_1 = __webpack_require__(/*! ./statements/export */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/export.js\");\r\nconst scan_1 = __webpack_require__(/*! ./statements/scan */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/scan.js\");\r\nconst submit_1 = __webpack_require__(/*! ./statements/submit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/submit.js\");\r\nconst open_dataset_1 = __webpack_require__(/*! ./statements/open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/open_dataset.js\");\r\nconst close_dataset_1 = __webpack_require__(/*! ./statements/close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/close_dataset.js\");\r\nconst get_run_time_1 = __webpack_require__(/*! ./statements/get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_run_time.js\");\r\nconst update_database_1 = __webpack_require__(/*! ./statements/update_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/update_database.js\");\r\nconst add_1 = __webpack_require__(/*! ./statements/add */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add.js\");\r\nconst subtract_1 = __webpack_require__(/*! ./statements/subtract */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract.js\");\r\nconst add_corresponding_1 = __webpack_require__(/*! ./statements/add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add_corresponding.js\");\r\nconst subtract_corresponding_1 = __webpack_require__(/*! ./statements/subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract_corresponding.js\");\r\nconst multiply_1 = __webpack_require__(/*! ./statements/multiply */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/multiply.js\");\r\nconst divide_1 = __webpack_require__(/*! ./statements/divide */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/divide.js\");\r\nconst condense_1 = __webpack_require__(/*! ./statements/condense */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/condense.js\");\r\nconst controls_1 = __webpack_require__(/*! ./statements/controls */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/controls.js\");\r\nconst while_1 = __webpack_require__(/*! ./statements/while */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/while.js\");\r\nconst select_loop_1 = __webpack_require__(/*! ./statements/select_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select_loop.js\");\r\nconst check_1 = __webpack_require__(/*! ./statements/check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/check.js\");\r\nconst log_point_1 = __webpack_require__(/*! ./statements/log_point */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/log_point.js\");\r\nconst severity_1 = __webpack_require__(/*! ../../severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\nconst raise_event_1 = __webpack_require__(/*! ./statements/raise_event */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise_event.js\");\r\nconst form_1 = __webpack_require__(/*! ./statements/form */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/form.js\");\r\nconst assert_1 = __webpack_require__(/*! ./statements/assert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assert.js\");\r\nconst set_parameter_1 = __webpack_require__(/*! ./statements/set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_parameter.js\");\r\nconst class_local_friends_1 = __webpack_require__(/*! ./statements/class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_local_friends.js\");\r\nconst get_badi_1 = __webpack_require__(/*! ./statements/get_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_badi.js\");\r\nconst with_1 = __webpack_require__(/*! ./statements/with */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with.js\");\r\nconst with_loop_1 = __webpack_require__(/*! ./statements/with_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with_loop.js\");\r\nconst system_call_1 = __webpack_require__(/*! ./statements/system_call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/system_call.js\");\r\nconst collect_1 = __webpack_require__(/*! ./statements/collect */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/collect.js\");\r\nconst transfer_1 = __webpack_require__(/*! ./statements/transfer */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/transfer.js\");\r\nconst modify_database_1 = __webpack_require__(/*! ./statements/modify_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_database.js\");\r\nconst truncate_dataset_1 = __webpack_require__(/*! ./statements/truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/truncate_dataset.js\");\r\nconst call_badi_1 = __webpack_require__(/*! ./statements/call_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_badi.js\");\r\nconst call_kernel_1 = __webpack_require__(/*! ./statements/call_kernel */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_kernel.js\");\r\nconst pack_1 = __webpack_require__(/*! ./statements/pack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/pack.js\");\r\nconst unpack_1 = __webpack_require__(/*! ./statements/unpack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unpack.js\");\r\nconst format_1 = __webpack_require__(/*! ./statements/format */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/format.js\");\r\nconst set_pf_status_1 = __webpack_require__(/*! ./statements/set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_pf_status.js\");\r\nconst set_titlebar_1 = __webpack_require__(/*! ./statements/set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_titlebar.js\");\r\nconst call_transaction_1 = __webpack_require__(/*! ./statements/call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transaction.js\");\r\nconst set_handler_1 = __webpack_require__(/*! ./statements/set_handler */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_handler.js\");\r\nconst wait_1 = __webpack_require__(/*! ./statements/wait */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/wait.js\");\r\nconst delete_report_1 = __webpack_require__(/*! ./statements/delete_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_report.js\");\r\nconst shift_1 = __webpack_require__(/*! ./statements/shift */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js\");\r\nconst set_bit_1 = __webpack_require__(/*! ./statements/set_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_bit.js\");\r\nconst modify_screen_1 = __webpack_require__(/*! ./statements/modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_screen.js\");\r\nconst delete_cluster_1 = __webpack_require__(/*! ./statements/delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_cluster.js\");\r\nconst unassign_1 = __webpack_require__(/*! ./statements/unassign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unassign.js\");\r\nconst insert_textpool_1 = __webpack_require__(/*! ./statements/insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_textpool.js\");\r\nconst get_cursor_1 = __webpack_require__(/*! ./statements/get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_cursor.js\");\r\nconst loop_at_screen_1 = __webpack_require__(/*! ./statements/loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop_at_screen.js\");\r\nconst insert_field_group_1 = __webpack_require__(/*! ./statements/insert_field_group */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_field_group.js\");\r\nconst read_entities_1 = __webpack_require__(/*! ./statements/read_entities */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_entities.js\");\r\nconst modify_entities_1 = __webpack_require__(/*! ./statements/modify_entities */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_entities.js\");\r\nconst commit_entities_1 = __webpack_require__(/*! ./statements/commit_entities */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/commit_entities.js\");\r\n// -----------------------------------\r\nconst map = {};\r\nfunction addToMap(handler) {\r\n if (map[handler.constructor.name] !== undefined) {\r\n throw new Error(\"syntax.ts duplicate statement syntax handler\");\r\n }\r\n map[handler.constructor.name] = handler;\r\n}\r\nif (Object.keys(map).length === 0) {\r\n addToMap(new interface_deferred_1.InterfaceDeferred());\r\n addToMap(new perform_1.Perform());\r\n addToMap(new class_deferred_1.ClassDeferred());\r\n addToMap(new call_1.Call());\r\n addToMap(new set_handler_1.SetHandler());\r\n addToMap(new class_implementation_1.ClassImplementation());\r\n addToMap(new method_implementation_1.MethodImplementation());\r\n addToMap(new move_1.Move());\r\n addToMap(new get_badi_1.GetBadi());\r\n addToMap(new call_badi_1.CallBadi());\r\n addToMap(new get_cursor_1.GetCursor());\r\n addToMap(new replace_1.Replace());\r\n addToMap(new truncate_dataset_1.TruncateDataset());\r\n addToMap(new assert_1.Assert());\r\n addToMap(new catch_1.Catch());\r\n addToMap(new loop_1.Loop());\r\n addToMap(new loop_at_screen_1.LoopAtScreen());\r\n addToMap(new set_pf_status_1.SetPFStatus());\r\n addToMap(new set_titlebar_1.SetTitlebar());\r\n addToMap(new submit_1.Submit());\r\n addToMap(new insert_textpool_1.InsertTextpool());\r\n addToMap(new read_table_1.ReadTable());\r\n addToMap(new syntax_check_1.SyntaxCheck());\r\n addToMap(new delete_report_1.DeleteReport());\r\n addToMap(new import_1.Import());\r\n addToMap(new collect_1.Collect());\r\n addToMap(new export_1.Export());\r\n addToMap(new scan_1.Scan());\r\n addToMap(new transfer_1.Transfer());\r\n addToMap(new split_1.Split());\r\n addToMap(new call_function_1.CallFunction());\r\n addToMap(new delete_internal_1.DeleteInternal());\r\n addToMap(new delete_cluster_1.DeleteCluster());\r\n addToMap(new clear_1.Clear());\r\n addToMap(new receive_1.Receive());\r\n addToMap(new get_bit_1.GetBit());\r\n addToMap(new class_local_friends_1.ClassLocalFriends());\r\n addToMap(new select_1.Select());\r\n addToMap(new modify_screen_1.ModifyScreen());\r\n addToMap(new insert_internal_1.InsertInternal());\r\n addToMap(new pack_1.Pack());\r\n addToMap(new unpack_1.Unpack());\r\n addToMap(new assign_1.Assign());\r\n addToMap(new set_locale_1.SetLocale());\r\n addToMap(new set_parameter_1.SetParameter());\r\n addToMap(new convert_1.Convert());\r\n addToMap(new controls_1.Controls());\r\n addToMap(new when_1.When());\r\n addToMap(new insert_database_1.InsertDatabase());\r\n addToMap(new delete_database_1.DeleteDatabase());\r\n addToMap(new update_database_1.UpdateDatabase());\r\n addToMap(new sort_1.Sort());\r\n addToMap(new wait_1.Wait());\r\n addToMap(new condense_1.Condense());\r\n addToMap(new set_bit_1.SetBit());\r\n addToMap(new open_dataset_1.OpenDataset());\r\n addToMap(new close_dataset_1.CloseDataset());\r\n addToMap(new read_report_1.ReadReport());\r\n addToMap(new do_1.Do());\r\n addToMap(new describe_1.Describe());\r\n addToMap(new find_1.Find());\r\n addToMap(new message_1.Message());\r\n addToMap(new system_call_1.SystemCall());\r\n addToMap(new insert_field_group_1.InsertFieldGroup());\r\n addToMap(new get_time_1.GetTime());\r\n addToMap(new unassign_1.Unassign());\r\n addToMap(new get_parameter_1.GetParameter());\r\n addToMap(new format_1.Format());\r\n addToMap(new when_type_1.WhenType());\r\n addToMap(new if_1.If());\r\n addToMap(new log_point_1.LogPoint());\r\n addToMap(new while_1.While());\r\n addToMap(new with_1.With());\r\n addToMap(new with_loop_1.WithLoop());\r\n addToMap(new call_transformation_1.CallTransformation());\r\n addToMap(new call_transaction_1.CallTransaction());\r\n addToMap(new get_locale_1.GetLocale());\r\n addToMap(new get_reference_1.GetReference());\r\n addToMap(new else_if_1.ElseIf());\r\n addToMap(new get_run_time_1.GetRunTime());\r\n addToMap(new create_object_1.CreateObject());\r\n addToMap(new import_dynpro_1.ImportDynpro());\r\n addToMap(new create_data_1.CreateData());\r\n addToMap(new case_1.Case());\r\n addToMap(new shift_1.Shift());\r\n addToMap(new raise_1.Raise());\r\n addToMap(new concatenate_1.Concatenate());\r\n addToMap(new append_1.Append());\r\n addToMap(new select_loop_1.SelectLoop());\r\n addToMap(new write_1.Write());\r\n addToMap(new move_corresponding_1.MoveCorresponding());\r\n addToMap(new authority_check_1.AuthorityCheck());\r\n addToMap(new insert_report_1.InsertReport());\r\n addToMap(new selection_screen_1.SelectionScreen());\r\n addToMap(new ranges_1.Ranges());\r\n addToMap(new add_1.Add());\r\n addToMap(new raise_event_1.RaiseEvent());\r\n addToMap(new subtract_1.Subtract());\r\n addToMap(new add_corresponding_1.AddCorresponding());\r\n addToMap(new subtract_corresponding_1.SubtractCorresponding());\r\n addToMap(new multiply_1.Multiply());\r\n addToMap(new divide_1.Divide());\r\n addToMap(new check_1.Check());\r\n addToMap(new modify_database_1.ModifyDatabase());\r\n addToMap(new form_1.Form());\r\n addToMap(new selectoption_1.SelectOption());\r\n addToMap(new tables_1.Tables());\r\n addToMap(new parameter_1.Parameter());\r\n addToMap(new fieldsymbol_1.FieldSymbol());\r\n addToMap(new read_entities_1.ReadEntities());\r\n addToMap(new modify_entities_1.ModifyEntities());\r\n addToMap(new commit_entities_1.CommitEntities());\r\n addToMap(new call_kernel_1.CallKernel());\r\n}\r\n// -----------------------------------\r\nclass SyntaxLogic {\r\n constructor(reg, object) {\r\n this.reg = reg;\r\n this.issues = [];\r\n this.object = object;\r\n this.scope = _current_scope_1.CurrentScope.buildDefault(this.reg, object);\r\n this.helpers = {\r\n oooc: new _object_oriented_1.ObjectOriented(this.scope),\r\n proc: new _procedural_1.Procedural(this.reg, this.scope),\r\n };\r\n }\r\n run() {\r\n if (this.object.syntaxResult !== undefined) {\r\n return this.object.syntaxResult;\r\n }\r\n this.issues = [];\r\n this.reg.getDDICReferences().clear(this.object);\r\n if (this.object instanceof objects_1.Program && this.object.isInclude()) {\r\n // todo, show some kind of error?\r\n return { issues: [], spaghetti: this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)) };\r\n }\r\n this.traverseObject();\r\n for (;;) {\r\n const spaghetti = this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)); // pop built-in scopes\r\n if (spaghetti.getTop().getIdentifier().stype === _scope_type_1.ScopeType.BuiltIn) {\r\n const result = { issues: this.issues, spaghetti };\r\n this.object.syntaxResult = result;\r\n return result;\r\n }\r\n }\r\n }\r\n /////////////////////////////\r\n traverseObject() {\r\n const traversal = this.object.getSequencedFiles();\r\n if (this.object instanceof objects_1.Program\r\n || this.object instanceof objects_1.FunctionGroup) {\r\n for (const f of this.object.getSequencedFiles()) {\r\n // add FORM defintions to the _global object scope\r\n this.helpers.proc.addAllFormDefinitions(f, this.object);\r\n }\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n let stype = _scope_type_1.ScopeType.Program;\r\n if (this.object instanceof objects_1.FunctionGroup) {\r\n stype = _scope_type_1.ScopeType.FunctionGroup;\r\n }\r\n this.scope.push(stype, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n else if (this.object instanceof objects_1.TypePool) {\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n this.scope.push(_scope_type_1.ScopeType.TypePool, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n for (const file of traversal) {\r\n this.currentFile = file;\r\n const structure = this.currentFile.getStructure();\r\n if (structure === undefined) {\r\n return this.scope;\r\n }\r\n else {\r\n this.traverse(structure);\r\n }\r\n }\r\n return this.scope;\r\n }\r\n newIssue(token, message) {\r\n const issue = issue_1.Issue.atToken(this.currentFile, token, message, \"check_syntax\", severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n traverse(node) {\r\n for (const child of node.getChildren()) {\r\n const isStructure = child instanceof nodes_1.StructureNode;\r\n const isStatement = child instanceof nodes_1.StatementNode;\r\n try {\r\n if (isStructure) {\r\n const gotoNext = this.updateScopeStructure(child);\r\n if (gotoNext === true) {\r\n continue;\r\n }\r\n }\r\n else if (isStatement) {\r\n this.updateScopeStatement(child);\r\n }\r\n }\r\n catch (e) {\r\n this.newIssue(child.getFirstToken(), e.message);\r\n break;\r\n }\r\n // walk into INCLUDEs\r\n if (isStatement && child.get() instanceof Statements.Include) {\r\n const file = this.helpers.proc.findInclude(child, this.object);\r\n if (file !== undefined && file.getStructure() !== undefined) {\r\n const old = this.currentFile;\r\n this.currentFile = file;\r\n this.traverse(file.getStructure());\r\n this.currentFile = old;\r\n }\r\n }\r\n if (isStructure || isStatement) {\r\n this.traverse(child);\r\n }\r\n }\r\n }\r\n // if this returns true, then the traversal should continue with next child\r\n updateScopeStructure(node) {\r\n const filename = this.currentFile.getFilename();\r\n const stru = node.get();\r\n if (stru instanceof Structures.ClassDefinition) {\r\n new class_definition_1.ClassDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Interface) {\r\n new interface_definition_1.InterfaceDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Types) {\r\n this.scope.addType(new types_1.Types().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Constants) {\r\n this.scope.addIdentifier(new constants_1.Constants().runSyntax(node, this.scope, filename).type);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Data) {\r\n this.scope.addIdentifier(new data_1.Data().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Statics) {\r\n this.scope.addIdentifier(new statics_1.Statics().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.TypeEnum) {\r\n const values = new type_enum_1.TypeEnum().runSyntax(node, this.scope, filename).values;\r\n this.scope.addList(values);\r\n return true;\r\n }\r\n return false;\r\n }\r\n updateScopeStatement(node) {\r\n const filename = this.currentFile.getFilename();\r\n const s = node.get();\r\n // todo, refactor\r\n if (s instanceof Statements.Type) {\r\n this.scope.addType(new type_1.Type().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Constant) {\r\n this.scope.addIdentifier(new constant_1.Constant().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Static) {\r\n this.scope.addIdentifier(new static_1.Static().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Data) {\r\n this.scope.addIdentifier(new data_2.Data().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n const name = s.constructor.name;\r\n if (map[name]) {\r\n map[name].runSyntax(node, this.scope, filename);\r\n return;\r\n }\r\n if (s instanceof Statements.FunctionModule) {\r\n this.helpers.proc.findFunctionScope(this.object, node, filename);\r\n }\r\n else if (s instanceof Statements.EndForm\r\n || s instanceof Statements.EndFunction\r\n || s instanceof Statements.EndClass\r\n || s instanceof Statements.EndInterface) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n else if (s instanceof Statements.EndMethod) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n if (this.scope.getType() === _scope_type_1.ScopeType.MethodInstance) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n }\r\n }\r\n}\r\nexports.SyntaxLogic = SyntaxLogic;\r\n//# sourceMappingURL=syntax.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js?");
|
|
8808
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyntaxLogic = void 0;\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _current_scope_1 = __webpack_require__(/*! ./_current_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst _procedural_1 = __webpack_require__(/*! ./_procedural */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_procedural.js\");\r\nconst objects_1 = __webpack_require__(/*! ../../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst data_1 = __webpack_require__(/*! ./structures/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/data.js\");\r\nconst type_enum_1 = __webpack_require__(/*! ./structures/type_enum */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/type_enum.js\");\r\nconst types_1 = __webpack_require__(/*! ./structures/types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/types.js\");\r\nconst statics_1 = __webpack_require__(/*! ./structures/statics */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/statics.js\");\r\nconst constants_1 = __webpack_require__(/*! ./structures/constants */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js\");\r\nconst class_definition_1 = __webpack_require__(/*! ../types/class_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/class_definition.js\");\r\nconst interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/interface_definition.js\");\r\nconst perform_1 = __webpack_require__(/*! ./statements/perform */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/perform.js\");\r\nconst type_1 = __webpack_require__(/*! ./statements/type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/type.js\");\r\nconst constant_1 = __webpack_require__(/*! ./statements/constant */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/constant.js\");\r\nconst static_1 = __webpack_require__(/*! ./statements/static */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/static.js\");\r\nconst search_1 = __webpack_require__(/*! ./statements/search */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/search.js\");\r\nconst translate_1 = __webpack_require__(/*! ./statements/translate */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/translate.js\");\r\nconst modify_internal_1 = __webpack_require__(/*! ./statements/modify_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_internal.js\");\r\nconst data_2 = __webpack_require__(/*! ./statements/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/data.js\");\r\nconst parameter_1 = __webpack_require__(/*! ./statements/parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/parameter.js\");\r\nconst fieldsymbol_1 = __webpack_require__(/*! ./statements/fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/fieldsymbol.js\");\r\nconst tables_1 = __webpack_require__(/*! ./statements/tables */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/tables.js\");\r\nconst selectoption_1 = __webpack_require__(/*! ./statements/selectoption */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selectoption.js\");\r\nconst interface_deferred_1 = __webpack_require__(/*! ./statements/interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/interface_deferred.js\");\r\nconst class_deferred_1 = __webpack_require__(/*! ./statements/class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_deferred.js\");\r\nconst call_1 = __webpack_require__(/*! ./statements/call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call.js\");\r\nconst class_implementation_1 = __webpack_require__(/*! ./statements/class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_implementation.js\");\r\nconst method_implementation_1 = __webpack_require__(/*! ./statements/method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/method_implementation.js\");\r\nconst move_1 = __webpack_require__(/*! ./statements/move */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js\");\r\nconst move_corresponding_1 = __webpack_require__(/*! ./statements/move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move_corresponding.js\");\r\nconst catch_1 = __webpack_require__(/*! ./statements/catch */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/catch.js\");\r\nconst loop_1 = __webpack_require__(/*! ./statements/loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop.js\");\r\nconst read_table_1 = __webpack_require__(/*! ./statements/read_table */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js\");\r\nconst select_1 = __webpack_require__(/*! ./statements/select */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select.js\");\r\nconst insert_internal_1 = __webpack_require__(/*! ./statements/insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_internal.js\");\r\nconst split_1 = __webpack_require__(/*! ./statements/split */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/split.js\");\r\nconst assign_1 = __webpack_require__(/*! ./statements/assign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assign.js\");\r\nconst convert_1 = __webpack_require__(/*! ./statements/convert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/convert.js\");\r\nconst describe_1 = __webpack_require__(/*! ./statements/describe */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/describe.js\");\r\nconst find_1 = __webpack_require__(/*! ./statements/find */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/find.js\");\r\nconst message_1 = __webpack_require__(/*! ./statements/message */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/message.js\");\r\nconst get_time_1 = __webpack_require__(/*! ./statements/get_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_time.js\");\r\nconst get_parameter_1 = __webpack_require__(/*! ./statements/get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_parameter.js\");\r\nconst when_type_1 = __webpack_require__(/*! ./statements/when_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when_type.js\");\r\nconst if_1 = __webpack_require__(/*! ./statements/if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/if.js\");\r\nconst else_if_1 = __webpack_require__(/*! ./statements/else_if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/else_if.js\");\r\nconst append_1 = __webpack_require__(/*! ./statements/append */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/append.js\");\r\nconst selection_screen_1 = __webpack_require__(/*! ./statements/selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selection_screen.js\");\r\nconst ranges_1 = __webpack_require__(/*! ./statements/ranges */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/ranges.js\");\r\nconst write_1 = __webpack_require__(/*! ./statements/write */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js\");\r\nconst case_1 = __webpack_require__(/*! ./statements/case */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/case.js\");\r\nconst create_object_1 = __webpack_require__(/*! ./statements/create_object */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js\");\r\nconst do_1 = __webpack_require__(/*! ./statements/do */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/do.js\");\r\nconst concatenate_1 = __webpack_require__(/*! ./statements/concatenate */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/concatenate.js\");\r\nconst call_function_1 = __webpack_require__(/*! ./statements/call_function */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_function.js\");\r\nconst clear_1 = __webpack_require__(/*! ./statements/clear */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/clear.js\");\r\nconst replace_1 = __webpack_require__(/*! ./statements/replace */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/replace.js\");\r\nconst get_bit_1 = __webpack_require__(/*! ./statements/get_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_bit.js\");\r\nconst raise_1 = __webpack_require__(/*! ./statements/raise */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise.js\");\r\nconst delete_internal_1 = __webpack_require__(/*! ./statements/delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_internal.js\");\r\nconst receive_1 = __webpack_require__(/*! ./statements/receive */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/receive.js\");\r\nconst when_1 = __webpack_require__(/*! ./statements/when */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when.js\");\r\nconst create_data_1 = __webpack_require__(/*! ./statements/create_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_data.js\");\r\nconst call_transformation_1 = __webpack_require__(/*! ./statements/call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transformation.js\");\r\nconst get_locale_1 = __webpack_require__(/*! ./statements/get_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_locale.js\");\r\nconst set_locale_1 = __webpack_require__(/*! ./statements/set_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_locale.js\");\r\nconst sort_1 = __webpack_require__(/*! ./statements/sort */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/sort.js\");\r\nconst read_report_1 = __webpack_require__(/*! ./statements/read_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_report.js\");\r\nconst authority_check_1 = __webpack_require__(/*! ./statements/authority_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/authority_check.js\");\r\nconst insert_report_1 = __webpack_require__(/*! ./statements/insert_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_report.js\");\r\nconst get_reference_1 = __webpack_require__(/*! ./statements/get_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_reference.js\");\r\nconst insert_database_1 = __webpack_require__(/*! ./statements/insert_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_database.js\");\r\nconst delete_database_1 = __webpack_require__(/*! ./statements/delete_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_database.js\");\r\nconst import_dynpro_1 = __webpack_require__(/*! ./statements/import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import_dynpro.js\");\r\nconst syntax_check_1 = __webpack_require__(/*! ./statements/syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/syntax_check.js\");\r\nconst import_1 = __webpack_require__(/*! ./statements/import */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import.js\");\r\nconst export_1 = __webpack_require__(/*! ./statements/export */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/export.js\");\r\nconst scan_1 = __webpack_require__(/*! ./statements/scan */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/scan.js\");\r\nconst submit_1 = __webpack_require__(/*! ./statements/submit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/submit.js\");\r\nconst open_dataset_1 = __webpack_require__(/*! ./statements/open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/open_dataset.js\");\r\nconst close_dataset_1 = __webpack_require__(/*! ./statements/close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/close_dataset.js\");\r\nconst get_run_time_1 = __webpack_require__(/*! ./statements/get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_run_time.js\");\r\nconst update_database_1 = __webpack_require__(/*! ./statements/update_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/update_database.js\");\r\nconst add_1 = __webpack_require__(/*! ./statements/add */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add.js\");\r\nconst subtract_1 = __webpack_require__(/*! ./statements/subtract */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract.js\");\r\nconst add_corresponding_1 = __webpack_require__(/*! ./statements/add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add_corresponding.js\");\r\nconst subtract_corresponding_1 = __webpack_require__(/*! ./statements/subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract_corresponding.js\");\r\nconst multiply_1 = __webpack_require__(/*! ./statements/multiply */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/multiply.js\");\r\nconst divide_1 = __webpack_require__(/*! ./statements/divide */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/divide.js\");\r\nconst condense_1 = __webpack_require__(/*! ./statements/condense */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/condense.js\");\r\nconst controls_1 = __webpack_require__(/*! ./statements/controls */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/controls.js\");\r\nconst while_1 = __webpack_require__(/*! ./statements/while */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/while.js\");\r\nconst select_loop_1 = __webpack_require__(/*! ./statements/select_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select_loop.js\");\r\nconst check_1 = __webpack_require__(/*! ./statements/check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/check.js\");\r\nconst log_point_1 = __webpack_require__(/*! ./statements/log_point */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/log_point.js\");\r\nconst severity_1 = __webpack_require__(/*! ../../severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\nconst raise_event_1 = __webpack_require__(/*! ./statements/raise_event */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise_event.js\");\r\nconst form_1 = __webpack_require__(/*! ./statements/form */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/form.js\");\r\nconst assert_1 = __webpack_require__(/*! ./statements/assert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assert.js\");\r\nconst set_parameter_1 = __webpack_require__(/*! ./statements/set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_parameter.js\");\r\nconst class_local_friends_1 = __webpack_require__(/*! ./statements/class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_local_friends.js\");\r\nconst get_badi_1 = __webpack_require__(/*! ./statements/get_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_badi.js\");\r\nconst with_1 = __webpack_require__(/*! ./statements/with */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with.js\");\r\nconst with_loop_1 = __webpack_require__(/*! ./statements/with_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with_loop.js\");\r\nconst system_call_1 = __webpack_require__(/*! ./statements/system_call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/system_call.js\");\r\nconst collect_1 = __webpack_require__(/*! ./statements/collect */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/collect.js\");\r\nconst transfer_1 = __webpack_require__(/*! ./statements/transfer */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/transfer.js\");\r\nconst modify_database_1 = __webpack_require__(/*! ./statements/modify_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_database.js\");\r\nconst truncate_dataset_1 = __webpack_require__(/*! ./statements/truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/truncate_dataset.js\");\r\nconst call_badi_1 = __webpack_require__(/*! ./statements/call_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_badi.js\");\r\nconst call_kernel_1 = __webpack_require__(/*! ./statements/call_kernel */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_kernel.js\");\r\nconst pack_1 = __webpack_require__(/*! ./statements/pack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/pack.js\");\r\nconst unpack_1 = __webpack_require__(/*! ./statements/unpack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unpack.js\");\r\nconst format_1 = __webpack_require__(/*! ./statements/format */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/format.js\");\r\nconst set_pf_status_1 = __webpack_require__(/*! ./statements/set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_pf_status.js\");\r\nconst set_titlebar_1 = __webpack_require__(/*! ./statements/set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_titlebar.js\");\r\nconst call_transaction_1 = __webpack_require__(/*! ./statements/call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transaction.js\");\r\nconst set_handler_1 = __webpack_require__(/*! ./statements/set_handler */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_handler.js\");\r\nconst wait_1 = __webpack_require__(/*! ./statements/wait */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/wait.js\");\r\nconst delete_report_1 = __webpack_require__(/*! ./statements/delete_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_report.js\");\r\nconst shift_1 = __webpack_require__(/*! ./statements/shift */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js\");\r\nconst set_bit_1 = __webpack_require__(/*! ./statements/set_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_bit.js\");\r\nconst modify_screen_1 = __webpack_require__(/*! ./statements/modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_screen.js\");\r\nconst delete_cluster_1 = __webpack_require__(/*! ./statements/delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_cluster.js\");\r\nconst unassign_1 = __webpack_require__(/*! ./statements/unassign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unassign.js\");\r\nconst insert_textpool_1 = __webpack_require__(/*! ./statements/insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_textpool.js\");\r\nconst get_cursor_1 = __webpack_require__(/*! ./statements/get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_cursor.js\");\r\nconst loop_at_screen_1 = __webpack_require__(/*! ./statements/loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop_at_screen.js\");\r\nconst insert_field_group_1 = __webpack_require__(/*! ./statements/insert_field_group */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_field_group.js\");\r\nconst read_entities_1 = __webpack_require__(/*! ./statements/read_entities */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_entities.js\");\r\nconst modify_entities_1 = __webpack_require__(/*! ./statements/modify_entities */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_entities.js\");\r\nconst commit_entities_1 = __webpack_require__(/*! ./statements/commit_entities */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/commit_entities.js\");\r\n// -----------------------------------\r\nconst map = {};\r\nfunction addToMap(handler) {\r\n if (map[handler.constructor.name] !== undefined) {\r\n throw new Error(\"syntax.ts duplicate statement syntax handler\");\r\n }\r\n map[handler.constructor.name] = handler;\r\n}\r\nif (Object.keys(map).length === 0) {\r\n addToMap(new interface_deferred_1.InterfaceDeferred());\r\n addToMap(new perform_1.Perform());\r\n addToMap(new class_deferred_1.ClassDeferred());\r\n addToMap(new call_1.Call());\r\n addToMap(new set_handler_1.SetHandler());\r\n addToMap(new class_implementation_1.ClassImplementation());\r\n addToMap(new method_implementation_1.MethodImplementation());\r\n addToMap(new move_1.Move());\r\n addToMap(new get_badi_1.GetBadi());\r\n addToMap(new call_badi_1.CallBadi());\r\n addToMap(new get_cursor_1.GetCursor());\r\n addToMap(new replace_1.Replace());\r\n addToMap(new truncate_dataset_1.TruncateDataset());\r\n addToMap(new assert_1.Assert());\r\n addToMap(new catch_1.Catch());\r\n addToMap(new loop_1.Loop());\r\n addToMap(new loop_at_screen_1.LoopAtScreen());\r\n addToMap(new set_pf_status_1.SetPFStatus());\r\n addToMap(new set_titlebar_1.SetTitlebar());\r\n addToMap(new submit_1.Submit());\r\n addToMap(new insert_textpool_1.InsertTextpool());\r\n addToMap(new read_table_1.ReadTable());\r\n addToMap(new syntax_check_1.SyntaxCheck());\r\n addToMap(new delete_report_1.DeleteReport());\r\n addToMap(new import_1.Import());\r\n addToMap(new collect_1.Collect());\r\n addToMap(new export_1.Export());\r\n addToMap(new scan_1.Scan());\r\n addToMap(new transfer_1.Transfer());\r\n addToMap(new split_1.Split());\r\n addToMap(new call_function_1.CallFunction());\r\n addToMap(new delete_internal_1.DeleteInternal());\r\n addToMap(new delete_cluster_1.DeleteCluster());\r\n addToMap(new clear_1.Clear());\r\n addToMap(new receive_1.Receive());\r\n addToMap(new get_bit_1.GetBit());\r\n addToMap(new class_local_friends_1.ClassLocalFriends());\r\n addToMap(new select_1.Select());\r\n addToMap(new modify_screen_1.ModifyScreen());\r\n addToMap(new insert_internal_1.InsertInternal());\r\n addToMap(new pack_1.Pack());\r\n addToMap(new unpack_1.Unpack());\r\n addToMap(new assign_1.Assign());\r\n addToMap(new set_locale_1.SetLocale());\r\n addToMap(new set_parameter_1.SetParameter());\r\n addToMap(new convert_1.Convert());\r\n addToMap(new controls_1.Controls());\r\n addToMap(new when_1.When());\r\n addToMap(new insert_database_1.InsertDatabase());\r\n addToMap(new delete_database_1.DeleteDatabase());\r\n addToMap(new update_database_1.UpdateDatabase());\r\n addToMap(new sort_1.Sort());\r\n addToMap(new wait_1.Wait());\r\n addToMap(new condense_1.Condense());\r\n addToMap(new set_bit_1.SetBit());\r\n addToMap(new open_dataset_1.OpenDataset());\r\n addToMap(new close_dataset_1.CloseDataset());\r\n addToMap(new read_report_1.ReadReport());\r\n addToMap(new do_1.Do());\r\n addToMap(new describe_1.Describe());\r\n addToMap(new find_1.Find());\r\n addToMap(new message_1.Message());\r\n addToMap(new system_call_1.SystemCall());\r\n addToMap(new insert_field_group_1.InsertFieldGroup());\r\n addToMap(new get_time_1.GetTime());\r\n addToMap(new unassign_1.Unassign());\r\n addToMap(new get_parameter_1.GetParameter());\r\n addToMap(new format_1.Format());\r\n addToMap(new when_type_1.WhenType());\r\n addToMap(new if_1.If());\r\n addToMap(new log_point_1.LogPoint());\r\n addToMap(new while_1.While());\r\n addToMap(new with_1.With());\r\n addToMap(new with_loop_1.WithLoop());\r\n addToMap(new call_transformation_1.CallTransformation());\r\n addToMap(new call_transaction_1.CallTransaction());\r\n addToMap(new get_locale_1.GetLocale());\r\n addToMap(new get_reference_1.GetReference());\r\n addToMap(new else_if_1.ElseIf());\r\n addToMap(new get_run_time_1.GetRunTime());\r\n addToMap(new create_object_1.CreateObject());\r\n addToMap(new import_dynpro_1.ImportDynpro());\r\n addToMap(new create_data_1.CreateData());\r\n addToMap(new case_1.Case());\r\n addToMap(new shift_1.Shift());\r\n addToMap(new raise_1.Raise());\r\n addToMap(new concatenate_1.Concatenate());\r\n addToMap(new append_1.Append());\r\n addToMap(new select_loop_1.SelectLoop());\r\n addToMap(new write_1.Write());\r\n addToMap(new move_corresponding_1.MoveCorresponding());\r\n addToMap(new authority_check_1.AuthorityCheck());\r\n addToMap(new insert_report_1.InsertReport());\r\n addToMap(new selection_screen_1.SelectionScreen());\r\n addToMap(new ranges_1.Ranges());\r\n addToMap(new add_1.Add());\r\n addToMap(new raise_event_1.RaiseEvent());\r\n addToMap(new subtract_1.Subtract());\r\n addToMap(new add_corresponding_1.AddCorresponding());\r\n addToMap(new subtract_corresponding_1.SubtractCorresponding());\r\n addToMap(new multiply_1.Multiply());\r\n addToMap(new divide_1.Divide());\r\n addToMap(new check_1.Check());\r\n addToMap(new modify_database_1.ModifyDatabase());\r\n addToMap(new form_1.Form());\r\n addToMap(new selectoption_1.SelectOption());\r\n addToMap(new tables_1.Tables());\r\n addToMap(new parameter_1.Parameter());\r\n addToMap(new fieldsymbol_1.FieldSymbol());\r\n addToMap(new read_entities_1.ReadEntities());\r\n addToMap(new modify_entities_1.ModifyEntities());\r\n addToMap(new commit_entities_1.CommitEntities());\r\n addToMap(new call_kernel_1.CallKernel());\r\n addToMap(new search_1.Search());\r\n addToMap(new translate_1.Translate());\r\n addToMap(new modify_internal_1.ModifyInternal());\r\n}\r\n// -----------------------------------\r\nclass SyntaxLogic {\r\n constructor(reg, object) {\r\n this.reg = reg;\r\n this.issues = [];\r\n this.object = object;\r\n this.scope = _current_scope_1.CurrentScope.buildDefault(this.reg, object);\r\n this.helpers = {\r\n oooc: new _object_oriented_1.ObjectOriented(this.scope),\r\n proc: new _procedural_1.Procedural(this.reg, this.scope),\r\n };\r\n }\r\n run() {\r\n if (this.object.syntaxResult !== undefined) {\r\n return this.object.syntaxResult;\r\n }\r\n this.issues = [];\r\n this.reg.getDDICReferences().clear(this.object);\r\n if (this.object instanceof objects_1.Program && this.object.isInclude()) {\r\n // todo, show some kind of error?\r\n return { issues: [], spaghetti: this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)) };\r\n }\r\n this.traverseObject();\r\n for (;;) {\r\n const spaghetti = this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)); // pop built-in scopes\r\n if (spaghetti.getTop().getIdentifier().stype === _scope_type_1.ScopeType.BuiltIn) {\r\n const result = { issues: this.issues, spaghetti };\r\n this.object.syntaxResult = result;\r\n return result;\r\n }\r\n }\r\n }\r\n /////////////////////////////\r\n traverseObject() {\r\n const traversal = this.object.getSequencedFiles();\r\n if (this.object instanceof objects_1.Program\r\n || this.object instanceof objects_1.FunctionGroup) {\r\n for (const f of this.object.getSequencedFiles()) {\r\n // add FORM defintions to the _global object scope\r\n this.helpers.proc.addAllFormDefinitions(f, this.object);\r\n }\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n let stype = _scope_type_1.ScopeType.Program;\r\n if (this.object instanceof objects_1.FunctionGroup) {\r\n stype = _scope_type_1.ScopeType.FunctionGroup;\r\n }\r\n this.scope.push(stype, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n else if (this.object instanceof objects_1.TypePool) {\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n this.scope.push(_scope_type_1.ScopeType.TypePool, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n for (const file of traversal) {\r\n this.currentFile = file;\r\n const structure = this.currentFile.getStructure();\r\n if (structure === undefined) {\r\n return this.scope;\r\n }\r\n else {\r\n this.traverse(structure);\r\n }\r\n }\r\n return this.scope;\r\n }\r\n newIssue(token, message) {\r\n const issue = issue_1.Issue.atToken(this.currentFile, token, message, \"check_syntax\", severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n traverse(node) {\r\n for (const child of node.getChildren()) {\r\n const isStructure = child instanceof nodes_1.StructureNode;\r\n const isStatement = child instanceof nodes_1.StatementNode;\r\n try {\r\n if (isStructure) {\r\n const gotoNext = this.updateScopeStructure(child);\r\n if (gotoNext === true) {\r\n continue;\r\n }\r\n }\r\n else if (isStatement) {\r\n this.updateScopeStatement(child);\r\n }\r\n }\r\n catch (e) {\r\n this.newIssue(child.getFirstToken(), e.message);\r\n break;\r\n }\r\n // walk into INCLUDEs\r\n if (isStatement && child.get() instanceof Statements.Include) {\r\n const file = this.helpers.proc.findInclude(child, this.object);\r\n if (file !== undefined && file.getStructure() !== undefined) {\r\n const old = this.currentFile;\r\n this.currentFile = file;\r\n this.traverse(file.getStructure());\r\n this.currentFile = old;\r\n }\r\n }\r\n if (isStructure || isStatement) {\r\n this.traverse(child);\r\n }\r\n }\r\n }\r\n // if this returns true, then the traversal should continue with next child\r\n updateScopeStructure(node) {\r\n const filename = this.currentFile.getFilename();\r\n const stru = node.get();\r\n if (stru instanceof Structures.ClassDefinition) {\r\n new class_definition_1.ClassDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Interface) {\r\n new interface_definition_1.InterfaceDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Types) {\r\n this.scope.addType(new types_1.Types().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Constants) {\r\n this.scope.addIdentifier(new constants_1.Constants().runSyntax(node, this.scope, filename).type);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Data) {\r\n this.scope.addIdentifier(new data_1.Data().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Statics) {\r\n this.scope.addIdentifier(new statics_1.Statics().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.TypeEnum) {\r\n const values = new type_enum_1.TypeEnum().runSyntax(node, this.scope, filename).values;\r\n this.scope.addList(values);\r\n return true;\r\n }\r\n return false;\r\n }\r\n updateScopeStatement(node) {\r\n const filename = this.currentFile.getFilename();\r\n const s = node.get();\r\n // todo, refactor\r\n if (s instanceof Statements.Type) {\r\n this.scope.addType(new type_1.Type().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Constant) {\r\n this.scope.addIdentifier(new constant_1.Constant().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Static) {\r\n this.scope.addIdentifier(new static_1.Static().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Data) {\r\n this.scope.addIdentifier(new data_2.Data().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n const name = s.constructor.name;\r\n if (map[name]) {\r\n map[name].runSyntax(node, this.scope, filename);\r\n return;\r\n }\r\n if (s instanceof Statements.FunctionModule) {\r\n this.helpers.proc.findFunctionScope(this.object, node, filename);\r\n }\r\n else if (s instanceof Statements.EndForm\r\n || s instanceof Statements.EndFunction\r\n || s instanceof Statements.EndClass\r\n || s instanceof Statements.EndInterface) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n else if (s instanceof Statements.EndMethod) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n if (this.scope.getType() === _scope_type_1.ScopeType.MethodInstance) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n }\r\n }\r\n}\r\nexports.SyntaxLogic = SyntaxLogic;\r\n//# sourceMappingURL=syntax.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js?");
|
|
8776
8809
|
|
|
8777
8810
|
/***/ }),
|
|
8778
8811
|
|
|
@@ -11676,7 +11709,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11676
11709
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11677
11710
|
|
|
11678
11711
|
"use strict";
|
|
11679
|
-
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.3\";\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/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11712
|
+
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/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11680
11713
|
|
|
11681
11714
|
/***/ }),
|
|
11682
11715
|
|
|
@@ -12853,7 +12886,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12853
12886
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12854
12887
|
|
|
12855
12888
|
"use strict";
|
|
12856
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PragmaStyle = exports.PragmaStyleConf = void 0;\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 keyword_case_1 = __webpack_require__(/*! ./keyword_case */ \"./node_modules/@abaplint/core/build/src/rules/keyword_case.js\");\r\nclass PragmaStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.style = keyword_case_1.KeywordCaseStyle.Upper;\r\n }\r\n}\r\nexports.PragmaStyleConf = PragmaStyleConf;\r\nclass PragmaStyle extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PragmaStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"pragma_style\",\r\n title: \"Pragma Style\",\r\n shortDescription: `Check pragmas
|
|
12889
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PragmaStyle = exports.PragmaStyleConf = void 0;\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 keyword_case_1 = __webpack_require__(/*! ./keyword_case */ \"./node_modules/@abaplint/core/build/src/rules/keyword_case.js\");\r\nclass PragmaStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.style = keyword_case_1.KeywordCaseStyle.Upper;\r\n }\r\n}\r\nexports.PragmaStyleConf = PragmaStyleConf;\r\nclass PragmaStyle extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PragmaStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"pragma_style\",\r\n title: \"Pragma Style\",\r\n shortDescription: `Check pragmas placement and case`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/abenpragma.htm`,\r\n badExample: `DATA field ##NO_TEXT TYPE i.`,\r\n goodExample: `DATA field TYPE i ##NO_TEXT.`,\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 if (this.conf.style === undefined) {\r\n this.conf.style = keyword_case_1.KeywordCaseStyle.Upper;\r\n }\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n if (s.getPragmas().length === 0) {\r\n continue;\r\n }\r\n for (const p of s.getPragmas()) {\r\n const children = s.getChildren();\r\n if (children.length === 1) {\r\n break; // empty statement with pragma\r\n }\r\n if (children[children.length - 2].getLastToken().getStart().isAfter(p.getStart())) {\r\n const message = \"Place pragma at end of statement\";\r\n const issue = issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue; // max one finding per statement\r\n }\r\n if (this.conf.style === keyword_case_1.KeywordCaseStyle.Upper && p.getStr() !== p.getStr().toUpperCase()) {\r\n const message = \"Upper case pragmas\";\r\n const issue = issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else if (this.conf.style === keyword_case_1.KeywordCaseStyle.Lower && p.getStr() !== p.getStr().toLowerCase()) {\r\n const message = \"Lower case pragmas\";\r\n const issue = issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PragmaStyle = PragmaStyle;\r\n//# sourceMappingURL=pragma_style.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/pragma_style.js?");
|
|
12857
12890
|
|
|
12858
12891
|
/***/ }),
|
|
12859
12892
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.94.
|
|
3
|
+
"version": "2.94.5",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abaplint": "./abaplint"
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://abaplint.org",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@abaplint/core": "^2.94.
|
|
40
|
+
"@abaplint/core": "^2.94.5",
|
|
41
41
|
"@types/chai": "^4.3.4",
|
|
42
42
|
"@types/glob": "^7.2.0",
|
|
43
43
|
"@types/minimist": "^1.2.2",
|
|
44
44
|
"@types/mocha": "^10.0.1",
|
|
45
|
-
"@types/node": "^18.11.
|
|
45
|
+
"@types/node": "^18.11.15",
|
|
46
46
|
"@types/progress": "^2.0.5",
|
|
47
47
|
"chai": "^4.3.7",
|
|
48
48
|
"chalk": "^5.2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"json5": "^2.2.1",
|
|
52
52
|
"memfs": "^3.4.12",
|
|
53
53
|
"minimist": "^1.2.7",
|
|
54
|
-
"mocha": "^10.
|
|
54
|
+
"mocha": "^10.2.0",
|
|
55
55
|
"progress": "^2.0.3",
|
|
56
56
|
"typescript": "^4.9.4",
|
|
57
57
|
"webpack": "^5.75.0",
|