@abaplint/core 2.114.3 → 2.114.5
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/abaplint.d.ts +1 -4
- package/build/src/abap/5_syntax/expressions/string_template.js +3 -1
- package/build/src/abap/5_syntax/statements/append.js +1 -0
- package/build/src/cds/cds_lexer.js +6 -1
- package/build/src/cds/expressions/cds_string.js +1 -1
- package/build/src/objects/lock_object.js +1 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/allowed_object_naming.js +2 -2
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -4305,10 +4305,7 @@ declare class Local implements IStatement {
|
|
|
4305
4305
|
declare class LockObject extends AbstractObject {
|
|
4306
4306
|
private parsedXML;
|
|
4307
4307
|
getType(): string;
|
|
4308
|
-
getAllowedNaming():
|
|
4309
|
-
maxLength: number;
|
|
4310
|
-
allowNamespace: boolean;
|
|
4311
|
-
};
|
|
4308
|
+
getAllowedNaming(): IAllowedNaming;
|
|
4312
4309
|
setDirty(): void;
|
|
4313
4310
|
getPrimaryTable(): string | undefined;
|
|
4314
4311
|
parseType(reg: IRegistry): AbstractType;
|
|
@@ -18,7 +18,9 @@ class StringTemplate {
|
|
|
18
18
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
19
19
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
20
20
|
}
|
|
21
|
-
else if ((typeUtils.isCharLike(type) === false
|
|
21
|
+
else if ((typeUtils.isCharLike(type) === false
|
|
22
|
+
&& typeUtils.isHexLike(type) === false
|
|
23
|
+
&& !(type instanceof basic_1.UTCLongType))
|
|
22
24
|
|| type instanceof basic_1.StructureType) {
|
|
23
25
|
const message = "String template, not character like, " + type.constructor.name;
|
|
24
26
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
@@ -44,6 +44,7 @@ class Append {
|
|
|
44
44
|
if (source) {
|
|
45
45
|
if (targetType !== undefined
|
|
46
46
|
&& !(targetType instanceof basic_1.TableType)
|
|
47
|
+
&& !(targetType instanceof basic_1.UnknownType)
|
|
47
48
|
&& dataTarget !== target
|
|
48
49
|
&& !(targetType instanceof basic_1.VoidType)) {
|
|
49
50
|
const message = `Append, target not a table type (${targetType.constructor.name})`;
|
|
@@ -66,7 +66,12 @@ class CDSLexer {
|
|
|
66
66
|
// string handling
|
|
67
67
|
if (mode === Mode.String) {
|
|
68
68
|
build += next;
|
|
69
|
-
if (next === "'") {
|
|
69
|
+
if (next === "'" && nextNext === "'") {
|
|
70
|
+
// escaped single quote, continue string
|
|
71
|
+
build += stream.takeNext();
|
|
72
|
+
col++;
|
|
73
|
+
}
|
|
74
|
+
else if (next === "'") {
|
|
70
75
|
build = result.add(build, row, col, mode);
|
|
71
76
|
mode = Mode.Default;
|
|
72
77
|
}
|
|
@@ -6,7 +6,7 @@ class CDSString extends combi_1.Expression {
|
|
|
6
6
|
getRunnable() {
|
|
7
7
|
const abap = (0, combi_1.seq)("abap", ".", (0, combi_1.regex)(/^char'\w'$/));
|
|
8
8
|
// https://stackoverflow.com/a/57754227
|
|
9
|
-
const reg = (0, combi_1.regex)(/^'[A-Za-zÀ-ž\u0370-\u03FF\u0400-\u04FF:\| -_]*'$/);
|
|
9
|
+
const reg = (0, combi_1.regex)(/^'([A-Za-zÀ-ž\u0370-\u03FF\u0400-\u04FF:\| -_]|'')*'$/);
|
|
10
10
|
return (0, combi_1.altPrio)(reg, abap);
|
|
11
11
|
}
|
|
12
12
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -34,14 +34,14 @@ class AllowedObjectNaming {
|
|
|
34
34
|
const name = obj.getName();
|
|
35
35
|
let message = "";
|
|
36
36
|
if (name.length > allowed.maxLength) {
|
|
37
|
-
message = "Name exceeds max length";
|
|
37
|
+
message = "Name exceeds max length, allowed is " + allowed.maxLength;
|
|
38
38
|
}
|
|
39
39
|
else if (allowed.allowNamespace === false && name.indexOf("/") >= 0) {
|
|
40
40
|
message = "Namespace not allowed for object type";
|
|
41
41
|
}
|
|
42
42
|
else if (allowed.customRegex !== undefined) {
|
|
43
43
|
if (name.match(allowed.customRegex) === null) {
|
|
44
|
-
message = "Name not allowed";
|
|
44
|
+
message = "Name not allowed, expected to match " + allowed.customRegex.toString();
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
else if (name.match(NAME_REGEX) === null) {
|