@abaplint/transpiler 2.3.7 → 2.3.8
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.
|
@@ -4,13 +4,17 @@ exports.WhileTranspiler = void 0;
|
|
|
4
4
|
const abaplint = require("@abaplint/core");
|
|
5
5
|
const expressions_1 = require("../expressions");
|
|
6
6
|
const chunk_1 = require("../chunk");
|
|
7
|
+
const unique_identifier_1 = require("../unique_identifier");
|
|
7
8
|
class WhileTranspiler {
|
|
8
9
|
transpile(node, traversal) {
|
|
9
10
|
const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);
|
|
11
|
+
const unique = unique_identifier_1.UniqueIdentifier.get();
|
|
10
12
|
return new chunk_1.Chunk()
|
|
11
|
-
.append(
|
|
13
|
+
.append(`let ${unique} = 1;
|
|
14
|
+
while (`, node, traversal)
|
|
12
15
|
.appendChunk(cond)
|
|
13
|
-
.
|
|
16
|
+
.appendString(`) {
|
|
17
|
+
abap.builtin.sy.get().index.set(${unique}++);`);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
exports.WhileTranspiler = WhileTranspiler;
|