@abaplint/core 2.94.0 → 2.94.1
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.
|
@@ -12,15 +12,18 @@ const type_1 = require("../statements/type");
|
|
|
12
12
|
const Basic = require("../../types/basic");
|
|
13
13
|
const _scope_type_1 = require("../_scope_type");
|
|
14
14
|
class Types {
|
|
15
|
-
runSyntax(node, scope, filename) {
|
|
15
|
+
runSyntax(node, scope, filename, qualifiedNamePrefix) {
|
|
16
16
|
const name = node.findFirstExpression(Expressions.NamespaceSimpleName).getFirstToken();
|
|
17
17
|
const components = [];
|
|
18
18
|
let voidd = undefined;
|
|
19
|
+
if (qualifiedNamePrefix === undefined) {
|
|
20
|
+
qualifiedNamePrefix = "";
|
|
21
|
+
}
|
|
19
22
|
for (const c of node.getChildren()) {
|
|
20
23
|
const ctyp = c.get();
|
|
21
24
|
if (c instanceof nodes_1.StatementNode) {
|
|
22
25
|
if (ctyp instanceof Statements.Type) {
|
|
23
|
-
const found = new type_1.Type().runSyntax(c, scope, filename, name.getStr() + "-");
|
|
26
|
+
const found = new type_1.Type().runSyntax(c, scope, filename, qualifiedNamePrefix + name.getStr() + "-");
|
|
24
27
|
if (found) {
|
|
25
28
|
components.push({ name: found.getName(), type: found.getType() });
|
|
26
29
|
}
|
|
@@ -36,7 +39,7 @@ class Types {
|
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.Types) {
|
|
39
|
-
const found = new Types().runSyntax(c, scope, filename);
|
|
42
|
+
const found = new Types().runSyntax(c, scope, filename, qualifiedNamePrefix + name.getStr() + "-");
|
|
40
43
|
if (found) {
|
|
41
44
|
components.push({ name: found.getName(), type: found.getType() });
|
|
42
45
|
}
|
|
@@ -48,10 +51,10 @@ class Types {
|
|
|
48
51
|
else if (components.length === 0) { // todo, remove this check
|
|
49
52
|
return undefined;
|
|
50
53
|
}
|
|
51
|
-
let qualifiedName = name.getStr();
|
|
54
|
+
let qualifiedName = qualifiedNamePrefix + name.getStr();
|
|
52
55
|
if (scope.getType() === _scope_type_1.ScopeType.ClassDefinition
|
|
53
56
|
|| scope.getType() === _scope_type_1.ScopeType.Interface) {
|
|
54
|
-
qualifiedName = scope.getName() + "=>" + qualifiedName;
|
|
57
|
+
qualifiedName = scope.getName() + "=>" + qualifiedNamePrefix + qualifiedName;
|
|
55
58
|
}
|
|
56
59
|
return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.StructureType(components, qualifiedName));
|
|
57
60
|
}
|
|
@@ -16,6 +16,14 @@ class Aliases {
|
|
|
16
16
|
getAll() {
|
|
17
17
|
return this.aliases;
|
|
18
18
|
}
|
|
19
|
+
getByName(name) {
|
|
20
|
+
for (const a of this.aliases) {
|
|
21
|
+
if (a.getName().toLowerCase() === name.toLowerCase()) {
|
|
22
|
+
return a;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
19
27
|
/////////////////////////
|
|
20
28
|
parse(node, scope, filename) {
|
|
21
29
|
const cdef = node.findFirstStructure(Structures.ClassDefinition);
|
package/build/src/registry.js
CHANGED