@abaplint/transpiler-cli 2.5.79 → 2.6.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.
- package/build/bundle.js +20 -9
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -67192,7 +67192,7 @@ class DatabaseSetup {
|
|
|
67192
67192
|
if (raw === undefined) {
|
|
67193
67193
|
return "";
|
|
67194
67194
|
}
|
|
67195
|
-
return `INSERT INTO reposrc ('PROGNAME', 'DATA') VALUES ('${name}', '${this.escape(raw)}');`;
|
|
67195
|
+
return `INSERT INTO reposrc ('PROGNAME', 'DATA') VALUES ('${name.padEnd(40, " ")}', '${this.escape(raw)}');`;
|
|
67196
67196
|
}
|
|
67197
67197
|
insertT000() {
|
|
67198
67198
|
const tabl = this.reg.getObject("TABL", "T000");
|
|
@@ -67210,12 +67210,13 @@ class DatabaseSetup {
|
|
|
67210
67210
|
}
|
|
67211
67211
|
insertT100(msag) {
|
|
67212
67212
|
// ignore if T100 is unknown
|
|
67213
|
-
|
|
67213
|
+
const obj = this.reg.getObject("TABL", "T100");
|
|
67214
|
+
if (obj === undefined) {
|
|
67214
67215
|
return "";
|
|
67215
67216
|
}
|
|
67216
67217
|
let ret = "";
|
|
67217
67218
|
for (const m of msag.getMessages()) {
|
|
67218
|
-
ret += `INSERT INTO t100 ('SPRSL', 'ARBGB', 'MSGNR', 'TEXT') VALUES ('E', '${msag.getName()}', '${m.getNumber()}', '${this.escape(m.getMessage())}')
|
|
67219
|
+
ret += `INSERT INTO t100 ('SPRSL', 'ARBGB', 'MSGNR', 'TEXT') VALUES ('E', '${msag.getName().padEnd(20, " ")}', '${m.getNumber()}', '${this.escape(m.getMessage().padEnd(73, " "))}');\n`;
|
|
67219
67220
|
}
|
|
67220
67221
|
return ret;
|
|
67221
67222
|
}
|
|
@@ -67319,7 +67320,7 @@ class SQLiteDatabaseSchema {
|
|
|
67319
67320
|
}
|
|
67320
67321
|
toType(type, fieldname, errorInfo) {
|
|
67321
67322
|
if (type instanceof abaplint.BasicTypes.CharacterType) {
|
|
67322
|
-
return `NCHAR(${type.getLength()})`;
|
|
67323
|
+
return `NCHAR(${type.getLength()}) COLLATE RTRIM`;
|
|
67323
67324
|
}
|
|
67324
67325
|
else if (type instanceof abaplint.BasicTypes.TimeType) {
|
|
67325
67326
|
return `NCHAR(6)`;
|
|
@@ -67332,7 +67333,7 @@ class SQLiteDatabaseSchema {
|
|
|
67332
67333
|
return `NCHAR(${type.getLength()})`;
|
|
67333
67334
|
}
|
|
67334
67335
|
else if (type instanceof abaplint.BasicTypes.StringType) {
|
|
67335
|
-
return `TEXT`;
|
|
67336
|
+
return `TEXT COLLATE RTRIM`;
|
|
67336
67337
|
}
|
|
67337
67338
|
else if (type instanceof abaplint.BasicTypes.XStringType) {
|
|
67338
67339
|
// it will be fine, the runtime representation of xstring is also text
|
|
@@ -68041,7 +68042,7 @@ class ConstantTranspiler {
|
|
|
68041
68042
|
if (str) {
|
|
68042
68043
|
let res = str.getFirstToken().getStr();
|
|
68043
68044
|
if (res.startsWith("'") && this.addGet === false) {
|
|
68044
|
-
const code =
|
|
68045
|
+
const code = this.character(res);
|
|
68045
68046
|
return new chunk_1.Chunk().append(code, node, traversal);
|
|
68046
68047
|
}
|
|
68047
68048
|
else if (res.startsWith("`") && this.addGet === false) {
|
|
@@ -68069,7 +68070,7 @@ class ConstantTranspiler {
|
|
|
68069
68070
|
chunk.appendString(",");
|
|
68070
68071
|
}
|
|
68071
68072
|
if (res.startsWith("'") && this.addGet === false) {
|
|
68072
|
-
const code =
|
|
68073
|
+
const code = this.character(res);
|
|
68073
68074
|
chunk.append(code, node, traversal);
|
|
68074
68075
|
}
|
|
68075
68076
|
else if (res.startsWith("`") && this.addGet === false) {
|
|
@@ -68082,6 +68083,16 @@ class ConstantTranspiler {
|
|
|
68082
68083
|
}
|
|
68083
68084
|
return new chunk_1.Chunk(`todo, Constant`);
|
|
68084
68085
|
}
|
|
68086
|
+
character(res) {
|
|
68087
|
+
const foo = res.replace(/''/g, "'");
|
|
68088
|
+
let length = foo.length - 2;
|
|
68089
|
+
if (length <= 0) {
|
|
68090
|
+
// note: Characters cannot have length = zero, 1 is minimum
|
|
68091
|
+
length = 1;
|
|
68092
|
+
}
|
|
68093
|
+
const code = "new abap.types.Character(" + length + ").set(" + this.escape(res) + ")";
|
|
68094
|
+
return code;
|
|
68095
|
+
}
|
|
68085
68096
|
escape(str) {
|
|
68086
68097
|
str = str.replace(/\\/g, "\\\\");
|
|
68087
68098
|
if (str.startsWith("'")) {
|
|
@@ -68858,7 +68869,7 @@ class MethodSourceTranspiler {
|
|
|
68858
68869
|
}
|
|
68859
68870
|
call += "[";
|
|
68860
68871
|
call += traversal.traverse(second).getCode();
|
|
68861
|
-
call += ".get().toLowerCase()]";
|
|
68872
|
+
call += ".get().toLowerCase().trimEnd()]";
|
|
68862
68873
|
}
|
|
68863
68874
|
else if (second.get() instanceof core_1.Expressions.Constant) {
|
|
68864
68875
|
if (call === "") {
|
|
@@ -68867,7 +68878,7 @@ class MethodSourceTranspiler {
|
|
|
68867
68878
|
else if (call.endsWith(".") === false) {
|
|
68868
68879
|
call += ".";
|
|
68869
68880
|
}
|
|
68870
|
-
call += second.getFirstToken().getStr().replace(/\'/g, "").toLowerCase().replace("~", "$");
|
|
68881
|
+
call += second.getFirstToken().getStr().replace(/\'/g, "").toLowerCase().replace("~", "$").trimEnd();
|
|
68871
68882
|
}
|
|
68872
68883
|
else {
|
|
68873
68884
|
ret.appendString("MethodSourceTranspiler-Unexpected");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.
|
|
28
|
+
"@abaplint/transpiler": "^2.6.1",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|