@abaplint/core 2.112.1 → 2.112.2
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/src/config.js +4 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
- package/build/adhoc/lexer_performance.d.ts +0 -1
- package/build/adhoc/lexer_performance.js +0 -17
- package/build/adhoc/parser_performance.d.ts +0 -1
- package/build/adhoc/parser_performance.js +0 -18
- package/build/adhoc/syntax_performance.d.ts +0 -1
- package/build/adhoc/syntax_performance.js +0 -185
- package/build/adhoc/typed_array.d.ts +0 -20
- package/build/adhoc/typed_array.js +0 -47
package/build/src/config.js
CHANGED
|
@@ -89,6 +89,10 @@ class Config {
|
|
|
89
89
|
if (this.config.syntax.globalConstants === undefined) {
|
|
90
90
|
this.config.syntax.globalConstants = [];
|
|
91
91
|
}
|
|
92
|
+
else {
|
|
93
|
+
// remove duplicates,
|
|
94
|
+
this.config.syntax.globalConstants = [...new Set(this.config.syntax.globalConstants)];
|
|
95
|
+
}
|
|
92
96
|
if (this.config.global.skipIncludesWithoutMain === undefined) {
|
|
93
97
|
this.config.global.skipIncludesWithoutMain = false;
|
|
94
98
|
}
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../src");
|
|
4
|
-
const lexer_1 = require("../src/abap/1_lexer/lexer");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
console.log("========================");
|
|
7
|
-
const file = new src_1.MemoryFile("abapgit.abap", fs.readFileSync("./lexer_performance.abap", "utf-8"));
|
|
8
|
-
let total = 0;
|
|
9
|
-
for (let i = 0; i < 10; i++) {
|
|
10
|
-
const before = Date.now();
|
|
11
|
-
const result = new lexer_1.Lexer().run(file);
|
|
12
|
-
const runtime = Date.now() - before;
|
|
13
|
-
console.log("Runtime: " + runtime + "ms, Tokens: " + result.tokens.length);
|
|
14
|
-
total += runtime;
|
|
15
|
-
}
|
|
16
|
-
console.log("Total: " + total + "ms");
|
|
17
|
-
//# sourceMappingURL=lexer_performance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../src");
|
|
4
|
-
const lexer_1 = require("../src/abap/1_lexer/lexer");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const statement_parser_1 = require("../src/abap/2_statements/statement_parser");
|
|
7
|
-
console.log("========================");
|
|
8
|
-
const file = new src_1.MemoryFile("abapgit.abap", fs.readFileSync("./lexer_performance.abap", "utf-8"));
|
|
9
|
-
const lexerResult = new lexer_1.Lexer().run(file);
|
|
10
|
-
let total = 0;
|
|
11
|
-
for (let i = 0; i < 4; i++) {
|
|
12
|
-
const before = Date.now();
|
|
13
|
-
new statement_parser_1.StatementParser(src_1.Version.v702).run([lexerResult], []);
|
|
14
|
-
const runtime = Date.now() - before;
|
|
15
|
-
total += runtime;
|
|
16
|
-
}
|
|
17
|
-
console.log("Total: " + total + "ms");
|
|
18
|
-
//# sourceMappingURL=parser_performance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../src");
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
console.log("========================");
|
|
6
|
-
const file1 = new src_1.MemoryFile("abapgit.prog.abap", fs.readFileSync("./lexer_performance.abap", "utf-8"));
|
|
7
|
-
const reg = new src_1.Registry().addFile(file1);
|
|
8
|
-
reg.addFile(new src_1.MemoryFile("cx_root.clas.abap", `
|
|
9
|
-
CLASS cx_root DEFINITION ABSTRACT PUBLIC.
|
|
10
|
-
PUBLIC SECTION.
|
|
11
|
-
DATA previous TYPE REF TO cx_root.
|
|
12
|
-
DATA textid TYPE c LENGTH 32.
|
|
13
|
-
|
|
14
|
-
METHODS constructor
|
|
15
|
-
IMPORTING
|
|
16
|
-
textid LIKE textid OPTIONAL
|
|
17
|
-
previous TYPE REF TO cx_root OPTIONAL.
|
|
18
|
-
|
|
19
|
-
METHODS get_source_position
|
|
20
|
-
EXPORTING
|
|
21
|
-
program_name TYPE string
|
|
22
|
-
include_name TYPE string
|
|
23
|
-
source_line TYPE i.
|
|
24
|
-
|
|
25
|
-
INTERFACES if_message.
|
|
26
|
-
ALIASES get_longtext FOR if_message~get_longtext.
|
|
27
|
-
ALIASES get_text FOR if_message~get_text.
|
|
28
|
-
|
|
29
|
-
ENDCLASS.
|
|
30
|
-
|
|
31
|
-
CLASS cx_root IMPLEMENTATION.
|
|
32
|
-
|
|
33
|
-
METHOD constructor.
|
|
34
|
-
ENDMETHOD.
|
|
35
|
-
|
|
36
|
-
METHOD get_source_position.
|
|
37
|
-
ENDMETHOD.
|
|
38
|
-
|
|
39
|
-
METHOD if_message~get_longtext.
|
|
40
|
-
ENDMETHOD.
|
|
41
|
-
|
|
42
|
-
METHOD if_message~get_text.
|
|
43
|
-
ENDMETHOD.
|
|
44
|
-
|
|
45
|
-
ENDCLASS.`));
|
|
46
|
-
reg.addFile(new src_1.MemoryFile("cx_static_check.clas.abap", `
|
|
47
|
-
CLASS cx_static_check DEFINITION PUBLIC INHERITING FROM cx_root.
|
|
48
|
-
PUBLIC SECTION.
|
|
49
|
-
METHODS constructor
|
|
50
|
-
IMPORTING
|
|
51
|
-
textid LIKE textid OPTIONAL
|
|
52
|
-
previous TYPE REF TO cx_root OPTIONAL.
|
|
53
|
-
ENDCLASS.
|
|
54
|
-
|
|
55
|
-
CLASS cx_static_check IMPLEMENTATION.
|
|
56
|
-
METHOD constructor.
|
|
57
|
-
ENDMETHOD.
|
|
58
|
-
ENDCLASS.`));
|
|
59
|
-
reg.addFile(new src_1.MemoryFile("if_message.intf.abap", `
|
|
60
|
-
INTERFACE if_message PUBLIC.
|
|
61
|
-
METHODS get_text RETURNING VALUE(result) TYPE string.
|
|
62
|
-
|
|
63
|
-
METHODS get_longtext
|
|
64
|
-
IMPORTING preserve_newlines TYPE abap_bool OPTIONAL
|
|
65
|
-
RETURNING VALUE(result) TYPE string.
|
|
66
|
-
ENDINTERFACE.`));
|
|
67
|
-
reg.addFile(new src_1.MemoryFile("if_t100_message.intf.abap", `
|
|
68
|
-
INTERFACE if_t100_message PUBLIC.
|
|
69
|
-
|
|
70
|
-
DATA t100key TYPE scx_t100key.
|
|
71
|
-
|
|
72
|
-
CONSTANTS:
|
|
73
|
-
BEGIN OF default_textid,
|
|
74
|
-
msgid TYPE symsgid VALUE 'AB',
|
|
75
|
-
msgno TYPE symsgno VALUE '123',
|
|
76
|
-
attr1 TYPE scx_attrname VALUE '',
|
|
77
|
-
attr2 TYPE scx_attrname VALUE '',
|
|
78
|
-
attr3 TYPE scx_attrname VALUE '',
|
|
79
|
-
attr4 TYPE scx_attrname VALUE '',
|
|
80
|
-
END OF default_textid.
|
|
81
|
-
|
|
82
|
-
ENDINTERFACE.`));
|
|
83
|
-
reg.setConfig(new src_1.Config(`
|
|
84
|
-
{
|
|
85
|
-
"global": {
|
|
86
|
-
"files": "/src/**/*.*"
|
|
87
|
-
},
|
|
88
|
-
"dependencies": [],
|
|
89
|
-
"syntax": {
|
|
90
|
-
"version": "v702",
|
|
91
|
-
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
|
|
92
|
-
"globalConstants": [
|
|
93
|
-
"abap_func_exporting",
|
|
94
|
-
"abap_func_tables",
|
|
95
|
-
"cssf_formtype_text",
|
|
96
|
-
"icon_abap",
|
|
97
|
-
"icon_adopt",
|
|
98
|
-
"icon_change",
|
|
99
|
-
"icon_create",
|
|
100
|
-
"icon_delete",
|
|
101
|
-
"icon_display_text",
|
|
102
|
-
"icon_folder",
|
|
103
|
-
"icon_led_green",
|
|
104
|
-
"icon_led_inactive",
|
|
105
|
-
"icon_led_red",
|
|
106
|
-
"icon_led_yellow",
|
|
107
|
-
"icon_message_information",
|
|
108
|
-
"icon_okay",
|
|
109
|
-
"icon_set_state",
|
|
110
|
-
"icon_stack",
|
|
111
|
-
"icon_system_help",
|
|
112
|
-
"icon_workflow_fork",
|
|
113
|
-
"seoc_category_exception",
|
|
114
|
-
"seoc_category_webdynpro_class",
|
|
115
|
-
"seoc_exposure_private",
|
|
116
|
-
"seoc_exposure_protected",
|
|
117
|
-
"seoc_exposure_public",
|
|
118
|
-
"seoc_state_implemented",
|
|
119
|
-
"seoc_version_active",
|
|
120
|
-
"seoc_version_deleted",
|
|
121
|
-
"seoc_version_inactive",
|
|
122
|
-
"seok_access_free",
|
|
123
|
-
"seok_access_modify",
|
|
124
|
-
"seox_false",
|
|
125
|
-
"seok_pgmid_r3tr",
|
|
126
|
-
"seoo_cmptype_type",
|
|
127
|
-
"seoo_cmptype_event",
|
|
128
|
-
"seoo_cmptype_method",
|
|
129
|
-
"seoo_cmptype_attribute",
|
|
130
|
-
"seop_ext_class_locals_def",
|
|
131
|
-
"seop_ext_class_locals_imp",
|
|
132
|
-
"seop_ext_class_macros",
|
|
133
|
-
"seop_ext_class_testclasses",
|
|
134
|
-
"seop_incextapp_definition",
|
|
135
|
-
"seop_incextapp_implementation",
|
|
136
|
-
"seop_incextapp_macros",
|
|
137
|
-
"seop_incextapp_testclasses",
|
|
138
|
-
"seos_scotype_exception",
|
|
139
|
-
"seos_scotype_parameter",
|
|
140
|
-
"seox_true",
|
|
141
|
-
"sews_c_vif_version",
|
|
142
|
-
"skwfc_obtype_folder",
|
|
143
|
-
"skwfc_obtype_loio",
|
|
144
|
-
"so2_controller",
|
|
145
|
-
"icon_no_status",
|
|
146
|
-
"icon_package_standard",
|
|
147
|
-
"srext_ext_class_pool",
|
|
148
|
-
"srext_ext_interface_pool",
|
|
149
|
-
"ststc_c_type_dialog",
|
|
150
|
-
"ststc_c_type_object",
|
|
151
|
-
"ststc_c_type_parameters",
|
|
152
|
-
"ststc_c_type_report",
|
|
153
|
-
"swbm_c_op_delete_no_dialog",
|
|
154
|
-
"swbm_c_type_ddic_db_tabxinx",
|
|
155
|
-
"swbm_c_type_wdy_application",
|
|
156
|
-
"swbm_version_active",
|
|
157
|
-
"swbm_version_inactive",
|
|
158
|
-
"wbmr_c_skwf_folder_class",
|
|
159
|
-
"wdyn_limu_component_controller",
|
|
160
|
-
"wdyn_limu_component_definition",
|
|
161
|
-
"wdyn_limu_component_view"
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
"rules": {
|
|
165
|
-
"begin_end_names": true,
|
|
166
|
-
"check_ddic": true,
|
|
167
|
-
"check_include": true,
|
|
168
|
-
"check_syntax": true,
|
|
169
|
-
"global_class": true,
|
|
170
|
-
"implement_methods": true,
|
|
171
|
-
"method_implemented_twice": true,
|
|
172
|
-
"parser_error": true,
|
|
173
|
-
"superclass_final": true,
|
|
174
|
-
"unknown_types": true,
|
|
175
|
-
"xml_consistency": true
|
|
176
|
-
}
|
|
177
|
-
}`));
|
|
178
|
-
reg.parse();
|
|
179
|
-
console.log("run syntax logic,");
|
|
180
|
-
const before = Date.now();
|
|
181
|
-
const issues = reg.findIssues();
|
|
182
|
-
console.dir(issues);
|
|
183
|
-
const runtime = Date.now() - before;
|
|
184
|
-
console.log("Total: " + runtime + "ms");
|
|
185
|
-
//# sourceMappingURL=syntax_performance.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare class Token {
|
|
2
|
-
private readonly col;
|
|
3
|
-
private readonly row;
|
|
4
|
-
private readonly type;
|
|
5
|
-
private readonly str;
|
|
6
|
-
constructor(col: number, row: number, type: number, str: string);
|
|
7
|
-
get(): {
|
|
8
|
-
a: number;
|
|
9
|
-
b: number;
|
|
10
|
-
c: number;
|
|
11
|
-
d: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
declare class TokensMemory {
|
|
15
|
-
private readonly strings;
|
|
16
|
-
private readonly memory;
|
|
17
|
-
private length;
|
|
18
|
-
add(col: number, row: number, type: number, str: string): void;
|
|
19
|
-
}
|
|
20
|
-
declare const count = 5000000;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
class Token {
|
|
3
|
-
constructor(col, row, type, str) {
|
|
4
|
-
this.col = col;
|
|
5
|
-
this.row = row;
|
|
6
|
-
this.type = type;
|
|
7
|
-
this.str = str;
|
|
8
|
-
}
|
|
9
|
-
get() {
|
|
10
|
-
return { a: this.col, b: this.row, c: this.type, d: this.str };
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
class TokensMemory {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.strings = [];
|
|
16
|
-
this.memory = new Int32Array();
|
|
17
|
-
this.length = 0;
|
|
18
|
-
}
|
|
19
|
-
add(col, row, type, str) {
|
|
20
|
-
this.memory[0 + this.length] = col;
|
|
21
|
-
this.memory[1 + this.length] = row;
|
|
22
|
-
this.memory[2 + this.length] = type;
|
|
23
|
-
this.memory[3 + this.length] = this.strings.length;
|
|
24
|
-
this.strings.push(str);
|
|
25
|
-
this.length++;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const count = 5000000;
|
|
29
|
-
{
|
|
30
|
-
const start = Date.now();
|
|
31
|
-
const mem = new TokensMemory();
|
|
32
|
-
for (let i = 0; i < count; i++) {
|
|
33
|
-
mem.add(i, i, i, "dfs" + i);
|
|
34
|
-
}
|
|
35
|
-
const runtime = Date.now() - start;
|
|
36
|
-
console.log("Typed Array: " + runtime + "ms");
|
|
37
|
-
}
|
|
38
|
-
{
|
|
39
|
-
const start = Date.now();
|
|
40
|
-
const tokens = [];
|
|
41
|
-
for (let i = 0; i < count; i++) {
|
|
42
|
-
tokens.push(new Token(i, i, i, "dfs" + i));
|
|
43
|
-
}
|
|
44
|
-
const runtime = Date.now() - start;
|
|
45
|
-
console.log("Objects: " + runtime + "ms");
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=typed_array.js.map
|