@abaplint/transpiler 2.3.75 → 2.3.76
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.
|
@@ -116,6 +116,7 @@ export * from "./start_of_selection";
|
|
|
116
116
|
export * from "./submit";
|
|
117
117
|
export * from "./subtract";
|
|
118
118
|
export * from "./syntax_check";
|
|
119
|
+
export * from "./tables";
|
|
119
120
|
export * from "./translate";
|
|
120
121
|
export * from "./truncate_dataset";
|
|
121
122
|
export * from "./try";
|
|
@@ -132,6 +132,7 @@ __exportStar(require("./start_of_selection"), exports);
|
|
|
132
132
|
__exportStar(require("./submit"), exports);
|
|
133
133
|
__exportStar(require("./subtract"), exports);
|
|
134
134
|
__exportStar(require("./syntax_check"), exports);
|
|
135
|
+
__exportStar(require("./tables"), exports);
|
|
135
136
|
__exportStar(require("./translate"), exports);
|
|
136
137
|
__exportStar(require("./truncate_dataset"), exports);
|
|
137
138
|
__exportStar(require("./try"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as abaplint from "@abaplint/core";
|
|
2
|
+
import { IStatementTranspiler } from "./_statement_transpiler";
|
|
3
|
+
import { Traversal } from "../traversal";
|
|
4
|
+
import { Chunk } from "../chunk";
|
|
5
|
+
export declare class TablesTranspiler implements IStatementTranspiler {
|
|
6
|
+
transpile(node: abaplint.Nodes.StatementNode, traversal: Traversal): Chunk;
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TablesTranspiler = void 0;
|
|
4
|
+
const abaplint = require("@abaplint/core");
|
|
5
|
+
const transpile_types_1 = require("../transpile_types");
|
|
6
|
+
const chunk_1 = require("../chunk");
|
|
7
|
+
class TablesTranspiler {
|
|
8
|
+
transpile(node, traversal) {
|
|
9
|
+
var _a;
|
|
10
|
+
const token = (_a = node.findFirstExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
11
|
+
if (token === undefined) {
|
|
12
|
+
throw new Error("TablesTranspiler, token not found");
|
|
13
|
+
}
|
|
14
|
+
const scope = traversal.findCurrentScopeByToken(token);
|
|
15
|
+
if (scope === undefined) {
|
|
16
|
+
throw new Error("TablesTranspiler, scope not found");
|
|
17
|
+
}
|
|
18
|
+
const found = scope.findVariable(token.getStr());
|
|
19
|
+
if (found === undefined) {
|
|
20
|
+
throw new Error("TablesTranspiler, var not found, \"" + token.getStr() + "\"");
|
|
21
|
+
}
|
|
22
|
+
const ret = new chunk_1.Chunk()
|
|
23
|
+
.appendString("let ")
|
|
24
|
+
.append(found.getName().toLowerCase(), token, traversal)
|
|
25
|
+
.appendString(" = " + new transpile_types_1.TranspileTypes().toType(found.getType()))
|
|
26
|
+
.append(";", node.getLastToken(), traversal);
|
|
27
|
+
return ret;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.TablesTranspiler = TablesTranspiler;
|
|
31
|
+
//# sourceMappingURL=tables.js.map
|