@abaplint/transpiler
Version:
25 lines • 996 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SQLOrderByTranspiler = void 0;
const abaplint = require("@abaplint/core");
const chunk_1 = require("../chunk");
const sql_field_name_1 = require("./sql_field_name");
class SQLOrderByTranspiler {
transpile(node, traversal) {
let text = "";
for (const c of node.getChildren()) {
if (c instanceof abaplint.Nodes.ExpressionNode && c.get() instanceof abaplint.Expressions.SQLFieldName) {
if (text !== "" && text.endsWith(`" `)) {
text += ", ";
}
text += new sql_field_name_1.SQLFieldNameTranspiler().transpile(c, traversal).getCode().toLowerCase() + " ";
}
else {
text += c.concatTokens() + " ";
}
}
return new chunk_1.Chunk().appendString(text);
}
}
exports.SQLOrderByTranspiler = SQLOrderByTranspiler;
//# sourceMappingURL=sql_order_by.js.map