@abaplint/transpiler 2.7.91 → 2.7.93
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.
|
@@ -49,6 +49,7 @@ export * from "./sql_from_source";
|
|
|
49
49
|
export * from "./sql_from";
|
|
50
50
|
export * from "./sql_into_structure";
|
|
51
51
|
export * from "./sql_join";
|
|
52
|
+
export * from "./sql_order_by";
|
|
52
53
|
export * from "./sql_source_simple";
|
|
53
54
|
export * from "./sql_source";
|
|
54
55
|
export * from "./sql_target";
|
|
@@ -65,6 +65,7 @@ __exportStar(require("./sql_from_source"), exports);
|
|
|
65
65
|
__exportStar(require("./sql_from"), exports);
|
|
66
66
|
__exportStar(require("./sql_into_structure"), exports);
|
|
67
67
|
__exportStar(require("./sql_join"), exports);
|
|
68
|
+
__exportStar(require("./sql_order_by"), exports);
|
|
68
69
|
__exportStar(require("./sql_source_simple"), exports);
|
|
69
70
|
__exportStar(require("./sql_source"), exports);
|
|
70
71
|
__exportStar(require("./sql_target"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Nodes } from "@abaplint/core";
|
|
2
|
+
import { IExpressionTranspiler } from "./_expression_transpiler";
|
|
3
|
+
import { Traversal } from "../traversal";
|
|
4
|
+
import { Chunk } from "../chunk";
|
|
5
|
+
export declare class SQLOrderByTranspiler implements IExpressionTranspiler {
|
|
6
|
+
transpile(node: Nodes.ExpressionNode, traversal: Traversal): Chunk;
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQLOrderByTranspiler = void 0;
|
|
4
|
+
const abaplint = require("@abaplint/core");
|
|
5
|
+
const chunk_1 = require("../chunk");
|
|
6
|
+
const sql_field_name_1 = require("./sql_field_name");
|
|
7
|
+
class SQLOrderByTranspiler {
|
|
8
|
+
transpile(node, traversal) {
|
|
9
|
+
const ret = new chunk_1.Chunk();
|
|
10
|
+
for (const c of node.getChildren()) {
|
|
11
|
+
if (c instanceof abaplint.Nodes.ExpressionNode && c.get() instanceof abaplint.Expressions.SQLFieldName) {
|
|
12
|
+
ret.appendString(new sql_field_name_1.SQLFieldNameTranspiler().transpile(c, traversal).getCode() + " ");
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
ret.appendString(c.concatTokens() + " ");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return ret;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.SQLOrderByTranspiler = SQLOrderByTranspiler;
|
|
22
|
+
//# sourceMappingURL=sql_order_by.js.map
|
|
@@ -33,6 +33,10 @@ class SelectTranspiler {
|
|
|
33
33
|
const code = new expressions_1.SQLFieldTranspiler().transpile(f, traversal).getCode();
|
|
34
34
|
fields.push(code);
|
|
35
35
|
}
|
|
36
|
+
else if (f instanceof abaplint.Nodes.ExpressionNode && f.get() instanceof abaplint.Expressions.SQLFieldName) {
|
|
37
|
+
const code = new expressions_1.SQLFieldNameTranspiler().transpile(f, traversal).getCode();
|
|
38
|
+
fields.push(code);
|
|
39
|
+
}
|
|
36
40
|
else {
|
|
37
41
|
fields.push(f.concatTokens());
|
|
38
42
|
}
|
|
@@ -64,7 +68,7 @@ class SelectTranspiler {
|
|
|
64
68
|
}
|
|
65
69
|
const orderBy = node.findFirstExpression(abaplint.Expressions.SQLOrderBy);
|
|
66
70
|
if (orderBy) {
|
|
67
|
-
select += orderBy.
|
|
71
|
+
select += new expressions_1.SQLOrderByTranspiler().transpile(orderBy, traversal).getCode();
|
|
68
72
|
}
|
|
69
73
|
for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {
|
|
70
74
|
const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.93",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"source-map": "^0.7.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/chai": "^4.3.
|
|
36
|
+
"@types/chai": "^4.3.6",
|
|
37
37
|
"@types/mocha": "^10.0.1",
|
|
38
38
|
"chai": "^4.3.8",
|
|
39
39
|
"mocha": "^10.2.0",
|