@abaplint/cli 2.105.4 → 2.105.6

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/cli.js CHANGED
@@ -931,7 +931,7 @@ async function loadDependencies(config, compress, bar, base) {
931
931
  function displayHelp() {
932
932
  // follow https://docopt.org conventions,
933
933
  return "Usage:\n" +
934
- " abaplint [<abaplint.json> -f <format> -c --outformat <format> --outfile <file> --fix] \n" +
934
+ " abaplint [<abaplint.json> -f <format> -c --outformat <format> --outfile <file> --fix --file <file>] \n" +
935
935
  " abaplint -h | --help show this help\n" +
936
936
  " abaplint -v | --version show version\n" +
937
937
  " abaplint -d | --default show default configuration\n" +
@@ -943,7 +943,8 @@ function displayHelp() {
943
943
  " --fix apply quick fixes to files\n" +
944
944
  " --rename rename object according to rules in abaplint.json\n" +
945
945
  " -p output performance information\n" +
946
- " -c compress files in memory\n";
946
+ " -c compress files in memory\n" +
947
+ " --file input file, glob format\n";
947
948
  }
948
949
  function out(issues, length, arg) {
949
950
  const output = _format_1.Formatter.format(issues, arg.format, length);
@@ -986,7 +987,9 @@ async function run(arg) {
986
987
  if (config.get().global.files === undefined) {
987
988
  throw "Error: Update abaplint configuration file to latest format";
988
989
  }
989
- const files = file_operations_1.FileOperations.loadFileNames(base + config.get().global.files);
990
+ const files = (arg.file)
991
+ ? file_operations_1.FileOperations.loadFileNames(base + arg.file)
992
+ : file_operations_1.FileOperations.loadFileNames(base + config.get().global.files);
990
993
  loaded = await file_operations_1.FileOperations.loadFiles(arg.compress, files, progress);
991
994
  deps = await loadDependencies(config, arg.compress, progress, base);
992
995
  reg = new core_1.Registry(config);
@@ -20124,31 +20127,34 @@ class BuiltIn {
20124
20127
  constructor() {
20125
20128
  this.row = 1;
20126
20129
  }
20127
- buildDefinition(method, row) {
20128
- const token = new tokens_1.Identifier(new position_1.Position(row, 1), method.name);
20129
- return new BuiltInMethod(token, BuiltIn.filename, method, row);
20130
+ buildDefinition(method, name) {
20131
+ if (method.cache) {
20132
+ return method.cache;
20133
+ }
20134
+ const token = new tokens_1.Identifier(new position_1.Position(1, 1), name);
20135
+ const result = new BuiltInMethod(token, BuiltIn.filename, method, method.counter);
20136
+ method.cache = result;
20137
+ return result;
20130
20138
  }
20131
20139
  searchBuiltin(name) {
20132
20140
  if (name === undefined) {
20133
20141
  return undefined;
20134
20142
  }
20135
- // todo, optimize, use hash map
20136
- const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());
20137
- if (index < 0) {
20143
+ const def = BuiltIn.methods[name.toUpperCase()];
20144
+ if (def === undefined) {
20138
20145
  return undefined;
20139
20146
  }
20140
- return this.buildDefinition(BuiltIn.methods[index], index);
20147
+ return this.buildDefinition(def, name);
20141
20148
  }
20142
20149
  isPredicate(name) {
20143
20150
  if (name === undefined) {
20144
20151
  return undefined;
20145
20152
  }
20146
- // todo, optimize, use hash map
20147
- const index = BuiltIn.methods.findIndex(a => a.name === name.toUpperCase());
20148
- if (index < 0) {
20153
+ const def = BuiltIn.methods[name.toUpperCase()];
20154
+ if (def === undefined) {
20149
20155
  return undefined;
20150
20156
  }
20151
- return BuiltIn.methods[index].predicate;
20157
+ return def.predicate;
20152
20158
  }
20153
20159
  getTypes() {
20154
20160
  const ret = this.buildSY();
@@ -20163,32 +20169,36 @@ class BuiltIn {
20163
20169
  return ret;
20164
20170
  }
20165
20171
  get(extras) {
20166
- const ret = this.buildSY();
20167
- ret.push(this.buildVariable("screen")); // todo, add structure, or alternatively make native Statements
20168
- ret.push(this.buildConstant("%_ENDIAN"));
20169
- ret.push(this.buildConstant("%_CHARSIZE"));
20170
- ret.push(this.buildConstant("%_BACKSPACE", new basic_1.CharacterType(1), "\b"));
20171
- ret.push(this.buildConstant("%_CR_LF", new basic_1.CharacterType(2), "\r\n"));
20172
- ret.push(this.buildConstant("%_FORMFEED", new basic_1.CharacterType(1), "\f"));
20173
- ret.push(this.buildConstant("%_HORIZONTAL_TAB", new basic_1.CharacterType(1), "\t"));
20174
- ret.push(this.buildConstant("%_MAXCHAR", new basic_1.CharacterType(1), Buffer.from("FDFF", "hex").toString()));
20175
- ret.push(this.buildConstant("%_MINCHAR", new basic_1.CharacterType(1), Buffer.from("0000", "hex").toString()));
20176
- ret.push(this.buildConstant("%_NEWLINE", new basic_1.CharacterType(1), "\n"));
20177
- ret.push(this.buildConstant("%_VERTICAL_TAB", new basic_1.CharacterType(1), "\v"));
20178
- ret.push(this.buildConstant("abap_false", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "' '"));
20179
- ret.push(this.buildConstant("abap_true", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'X'"));
20180
- ret.push(this.buildConstant("abap_undefined", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'-'"));
20181
- ret.push(this.buildConstant("abap_off", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "' '"));
20182
- ret.push(this.buildConstant("abap_on", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'X'"));
20183
- ret.push(this.buildConstant("col_background", basic_1.IntegerType.get(), "0"));
20184
- ret.push(this.buildConstant("col_heading", basic_1.IntegerType.get(), "1"));
20185
- ret.push(this.buildConstant("col_key", basic_1.IntegerType.get(), "4"));
20186
- ret.push(this.buildConstant("col_negative", basic_1.IntegerType.get(), "6"));
20187
- ret.push(this.buildConstant("col_group", basic_1.IntegerType.get(), "7"));
20188
- ret.push(this.buildConstant("col_normal", basic_1.IntegerType.get(), "2"));
20189
- ret.push(this.buildConstant("col_positive", basic_1.IntegerType.get(), "5"));
20190
- ret.push(this.buildConstant("col_total", basic_1.IntegerType.get(), "3"));
20191
- ret.push(this.buildConstant("space", new basic_1.CharacterType(1, { derivedFromConstant: true }), "' '"));
20172
+ const ret = [];
20173
+ if (BuiltIn.getCache.length === 0) {
20174
+ BuiltIn.getCache.push(...this.buildSY());
20175
+ BuiltIn.getCache.push(this.buildVariable("screen"));
20176
+ BuiltIn.getCache.push(this.buildConstant("%_ENDIAN"));
20177
+ BuiltIn.getCache.push(this.buildConstant("%_CHARSIZE"));
20178
+ BuiltIn.getCache.push(this.buildConstant("%_BACKSPACE", new basic_1.CharacterType(1), "\b"));
20179
+ BuiltIn.getCache.push(this.buildConstant("%_CR_LF", new basic_1.CharacterType(2), "\r\n"));
20180
+ BuiltIn.getCache.push(this.buildConstant("%_FORMFEED", new basic_1.CharacterType(1), "\f"));
20181
+ BuiltIn.getCache.push(this.buildConstant("%_HORIZONTAL_TAB", new basic_1.CharacterType(1), "\t"));
20182
+ BuiltIn.getCache.push(this.buildConstant("%_MAXCHAR", new basic_1.CharacterType(1), Buffer.from("FDFF", "hex").toString()));
20183
+ BuiltIn.getCache.push(this.buildConstant("%_MINCHAR", new basic_1.CharacterType(1), Buffer.from("0000", "hex").toString()));
20184
+ BuiltIn.getCache.push(this.buildConstant("%_NEWLINE", new basic_1.CharacterType(1), "\n"));
20185
+ BuiltIn.getCache.push(this.buildConstant("%_VERTICAL_TAB", new basic_1.CharacterType(1), "\v"));
20186
+ BuiltIn.getCache.push(this.buildConstant("abap_false", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "' '"));
20187
+ BuiltIn.getCache.push(this.buildConstant("abap_true", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'X'"));
20188
+ BuiltIn.getCache.push(this.buildConstant("abap_undefined", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'-'"));
20189
+ BuiltIn.getCache.push(this.buildConstant("abap_off", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "' '"));
20190
+ BuiltIn.getCache.push(this.buildConstant("abap_on", new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }), "'X'"));
20191
+ BuiltIn.getCache.push(this.buildConstant("col_background", basic_1.IntegerType.get(), "0"));
20192
+ BuiltIn.getCache.push(this.buildConstant("col_heading", basic_1.IntegerType.get(), "1"));
20193
+ BuiltIn.getCache.push(this.buildConstant("col_key", basic_1.IntegerType.get(), "4"));
20194
+ BuiltIn.getCache.push(this.buildConstant("col_negative", basic_1.IntegerType.get(), "6"));
20195
+ BuiltIn.getCache.push(this.buildConstant("col_group", basic_1.IntegerType.get(), "7"));
20196
+ BuiltIn.getCache.push(this.buildConstant("col_normal", basic_1.IntegerType.get(), "2"));
20197
+ BuiltIn.getCache.push(this.buildConstant("col_positive", basic_1.IntegerType.get(), "5"));
20198
+ BuiltIn.getCache.push(this.buildConstant("col_total", basic_1.IntegerType.get(), "3"));
20199
+ BuiltIn.getCache.push(this.buildConstant("space", new basic_1.CharacterType(1, { derivedFromConstant: true }), "' '"));
20200
+ }
20201
+ ret.push(...BuiltIn.getCache);
20192
20202
  for (const e of extras) {
20193
20203
  const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), e);
20194
20204
  ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(e), ["read_only" /* IdentifierMeta.ReadOnly */, "built-in" /* IdentifierMeta.BuiltIn */], "'?'"));
@@ -20196,6 +20206,10 @@ class BuiltIn {
20196
20206
  return ret;
20197
20207
  }
20198
20208
  /////////////////////////////
20209
+ buildVariable(name) {
20210
+ const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);
20211
+ return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), ["built-in" /* IdentifierMeta.BuiltIn */]);
20212
+ }
20199
20213
  buildSY() {
20200
20214
  const components = [];
20201
20215
  // NOTE: fields must be in correct sequence for the syntax check
@@ -20390,62 +20404,60 @@ class BuiltIn {
20390
20404
  }
20391
20405
  return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, type, ["read_only" /* IdentifierMeta.ReadOnly */, "built-in" /* IdentifierMeta.BuiltIn */], value);
20392
20406
  }
20393
- buildVariable(name) {
20394
- const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);
20395
- return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), ["built-in" /* IdentifierMeta.BuiltIn */]);
20396
- }
20397
20407
  }
20398
20408
  exports.BuiltIn = BuiltIn;
20399
20409
  BuiltIn.filename = "_builtin.prog.abap";
20410
+ BuiltIn.counter = 1;
20411
+ BuiltIn.getCache = [];
20400
20412
  // todo: "pcre" vs "regex", only one of these parameters are allowed
20401
20413
  // todo: "pcre", only possible from 755
20402
- BuiltIn.methods = [
20403
- {
20404
- name: "ABS",
20414
+ BuiltIn.methods = {
20415
+ "ABS": {
20416
+ counter: BuiltIn.counter++,
20405
20417
  mandatory: {
20406
20418
  "val": new basic_1.FloatType(),
20407
20419
  },
20408
20420
  return: basic_1.IntegerType.get(),
20409
20421
  },
20410
- {
20411
- name: "ACOS",
20422
+ "ACOS": {
20423
+ counter: BuiltIn.counter++,
20412
20424
  mandatory: {
20413
20425
  "val": new basic_1.FloatType(),
20414
20426
  },
20415
20427
  return: new basic_1.FloatType(),
20416
20428
  },
20417
- {
20418
- name: "ASIN",
20429
+ "ASIN": {
20430
+ counter: BuiltIn.counter++,
20419
20431
  mandatory: {
20420
20432
  "val": new basic_1.FloatType(),
20421
20433
  },
20422
20434
  return: new basic_1.FloatType(),
20423
20435
  },
20424
- {
20425
- name: "ATAN",
20436
+ "ATAN": {
20437
+ counter: BuiltIn.counter++,
20426
20438
  mandatory: {
20427
20439
  "val": new basic_1.FloatType(),
20428
20440
  },
20429
20441
  return: new basic_1.FloatType(),
20430
20442
  },
20431
- {
20432
- name: "BIT-SET",
20443
+ "BIT-SET": {
20444
+ counter: BuiltIn.counter++,
20433
20445
  mandatory: {
20434
20446
  "val": basic_1.IntegerType.get(),
20435
20447
  },
20436
20448
  return: new basic_1.XStringType(),
20437
20449
  version: version_1.Version.v702,
20438
20450
  },
20439
- {
20440
- name: "BOOLC",
20451
+ "BOOLC": {
20452
+ counter: BuiltIn.counter++,
20441
20453
  mandatory: {
20442
20454
  "val": basic_1.CLikeType.get(),
20443
20455
  },
20444
20456
  return: basic_1.StringType.get(),
20445
20457
  version: version_1.Version.v702,
20446
20458
  },
20447
- {
20448
- name: "BOOLX",
20459
+ "BOOLX": {
20460
+ counter: BuiltIn.counter++,
20449
20461
  mandatory: {
20450
20462
  "bool": basic_1.CLikeType.get(),
20451
20463
  },
@@ -20455,15 +20467,15 @@ BuiltIn.methods = [
20455
20467
  return: new basic_1.XStringType(),
20456
20468
  version: version_1.Version.v702,
20457
20469
  },
20458
- {
20459
- name: "CEIL",
20470
+ "CEIL": {
20471
+ counter: BuiltIn.counter++,
20460
20472
  mandatory: {
20461
20473
  "val": new basic_1.FloatType(),
20462
20474
  },
20463
20475
  return: basic_1.IntegerType.get(),
20464
20476
  },
20465
- {
20466
- name: "CHAR_OFF",
20477
+ "CHAR_OFF": {
20478
+ counter: BuiltIn.counter++,
20467
20479
  mandatory: {
20468
20480
  "val": basic_1.CLikeType.get(),
20469
20481
  "add": basic_1.IntegerType.get(),
@@ -20474,15 +20486,15 @@ BuiltIn.methods = [
20474
20486
  return: basic_1.IntegerType.get(),
20475
20487
  version: version_1.Version.v702,
20476
20488
  },
20477
- {
20478
- name: "CHARLEN",
20489
+ "CHARLEN": {
20490
+ counter: BuiltIn.counter++,
20479
20491
  mandatory: {
20480
20492
  "val": basic_1.CLikeType.get(),
20481
20493
  },
20482
20494
  return: basic_1.IntegerType.get(),
20483
20495
  },
20484
- {
20485
- name: "CMAX",
20496
+ "CMAX": {
20497
+ counter: BuiltIn.counter++,
20486
20498
  mandatory: {
20487
20499
  "val1": basic_1.CLikeType.get(),
20488
20500
  "val2": basic_1.CLikeType.get(),
@@ -20498,8 +20510,8 @@ BuiltIn.methods = [
20498
20510
  return: basic_1.StringType.get(),
20499
20511
  version: version_1.Version.v702,
20500
20512
  },
20501
- {
20502
- name: "CMIN",
20513
+ "CMIN": {
20514
+ counter: BuiltIn.counter++,
20503
20515
  mandatory: {
20504
20516
  "val1": basic_1.CLikeType.get(),
20505
20517
  "val2": basic_1.CLikeType.get(),
@@ -20515,8 +20527,8 @@ BuiltIn.methods = [
20515
20527
  return: basic_1.StringType.get(),
20516
20528
  version: version_1.Version.v702,
20517
20529
  },
20518
- {
20519
- name: "CONCAT_LINES_OF",
20530
+ "CONCAT_LINES_OF": {
20531
+ counter: BuiltIn.counter++,
20520
20532
  mandatory: {
20521
20533
  "table": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
20522
20534
  },
@@ -20526,8 +20538,8 @@ BuiltIn.methods = [
20526
20538
  return: basic_1.StringType.get(),
20527
20539
  version: version_1.Version.v702,
20528
20540
  },
20529
- {
20530
- name: "CONDENSE",
20541
+ "CONDENSE": {
20542
+ counter: BuiltIn.counter++,
20531
20543
  mandatory: {
20532
20544
  "val": basic_1.CLikeType.get(),
20533
20545
  },
@@ -20539,8 +20551,8 @@ BuiltIn.methods = [
20539
20551
  return: basic_1.StringType.get(),
20540
20552
  version: version_1.Version.v702,
20541
20553
  },
20542
- {
20543
- name: "CONTAINS",
20554
+ "CONTAINS": {
20555
+ counter: BuiltIn.counter++,
20544
20556
  mandatory: {
20545
20557
  "val": basic_1.CLikeType.get(),
20546
20558
  },
@@ -20559,8 +20571,8 @@ BuiltIn.methods = [
20559
20571
  predicate: true,
20560
20572
  version: version_1.Version.v702,
20561
20573
  },
20562
- {
20563
- name: "CONTAINS_ANY_NOT_OF",
20574
+ "CONTAINS_ANY_NOT_OF": {
20575
+ counter: BuiltIn.counter++,
20564
20576
  mandatory: {
20565
20577
  "val": basic_1.CLikeType.get(),
20566
20578
  },
@@ -20575,8 +20587,8 @@ BuiltIn.methods = [
20575
20587
  predicate: true,
20576
20588
  return: new basic_1.CharacterType(1), version: version_1.Version.v702,
20577
20589
  },
20578
- {
20579
- name: "CONTAINS_ANY_OF",
20590
+ "CONTAINS_ANY_OF": {
20591
+ counter: BuiltIn.counter++,
20580
20592
  mandatory: {
20581
20593
  "val": basic_1.CLikeType.get(),
20582
20594
  },
@@ -20592,22 +20604,22 @@ BuiltIn.methods = [
20592
20604
  predicate: true,
20593
20605
  version: version_1.Version.v702,
20594
20606
  },
20595
- {
20596
- name: "COS",
20607
+ "COS": {
20608
+ counter: BuiltIn.counter++,
20597
20609
  mandatory: {
20598
20610
  "val": new basic_1.FloatType(),
20599
20611
  },
20600
20612
  return: new basic_1.FloatType(),
20601
20613
  },
20602
- {
20603
- name: "COSH",
20614
+ "COSH": {
20615
+ counter: BuiltIn.counter++,
20604
20616
  mandatory: {
20605
20617
  "val": new basic_1.FloatType(),
20606
20618
  },
20607
20619
  return: new basic_1.FloatType(),
20608
20620
  },
20609
- {
20610
- name: "COUNT",
20621
+ "COUNT": {
20622
+ counter: BuiltIn.counter++,
20611
20623
  mandatory: {
20612
20624
  "val": basic_1.CLikeType.get(),
20613
20625
  },
@@ -20622,8 +20634,8 @@ BuiltIn.methods = [
20622
20634
  return: basic_1.IntegerType.get(),
20623
20635
  version: version_1.Version.v702,
20624
20636
  },
20625
- {
20626
- name: "COUNT_ANY_NOT_OF",
20637
+ "COUNT_ANY_NOT_OF": {
20638
+ counter: BuiltIn.counter++,
20627
20639
  mandatory: {
20628
20640
  "val": basic_1.CLikeType.get(),
20629
20641
  },
@@ -20638,8 +20650,8 @@ BuiltIn.methods = [
20638
20650
  return: basic_1.IntegerType.get(),
20639
20651
  version: version_1.Version.v702,
20640
20652
  },
20641
- {
20642
- name: "COUNT_ANY_OF",
20653
+ "COUNT_ANY_OF": {
20654
+ counter: BuiltIn.counter++,
20643
20655
  mandatory: {
20644
20656
  "val": basic_1.CLikeType.get(),
20645
20657
  },
@@ -20654,15 +20666,15 @@ BuiltIn.methods = [
20654
20666
  return: basic_1.IntegerType.get(),
20655
20667
  version: version_1.Version.v702,
20656
20668
  },
20657
- {
20658
- name: "DBMAXLEN",
20669
+ "DBMAXLEN": {
20670
+ counter: BuiltIn.counter++,
20659
20671
  mandatory: {
20660
20672
  "val": basic_1.CLikeType.get(),
20661
20673
  },
20662
20674
  return: basic_1.IntegerType.get(),
20663
20675
  },
20664
- {
20665
- name: "DISTANCE",
20676
+ "DISTANCE": {
20677
+ counter: BuiltIn.counter++,
20666
20678
  mandatory: {
20667
20679
  "val1": basic_1.CLikeType.get(),
20668
20680
  "val2": basic_1.CLikeType.get(),
@@ -20670,8 +20682,8 @@ BuiltIn.methods = [
20670
20682
  return: basic_1.IntegerType.get(),
20671
20683
  version: version_1.Version.v702,
20672
20684
  },
20673
- {
20674
- name: "ESCAPE",
20685
+ "ESCAPE": {
20686
+ counter: BuiltIn.counter++,
20675
20687
  mandatory: {
20676
20688
  "val": basic_1.CLikeType.get(),
20677
20689
  "format": basic_1.CLikeType.get(),
@@ -20679,15 +20691,15 @@ BuiltIn.methods = [
20679
20691
  return: basic_1.StringType.get(),
20680
20692
  version: version_1.Version.v702,
20681
20693
  },
20682
- {
20683
- name: "EXP",
20694
+ "EXP": {
20695
+ counter: BuiltIn.counter++,
20684
20696
  mandatory: {
20685
20697
  "val": new basic_1.FloatType(),
20686
20698
  },
20687
20699
  return: new basic_1.FloatType(),
20688
20700
  },
20689
- {
20690
- name: "FIND",
20701
+ "FIND": {
20702
+ counter: BuiltIn.counter++,
20691
20703
  mandatory: {
20692
20704
  "val": basic_1.CLikeType.get(),
20693
20705
  },
@@ -20703,8 +20715,8 @@ BuiltIn.methods = [
20703
20715
  return: basic_1.IntegerType.get(),
20704
20716
  version: version_1.Version.v702,
20705
20717
  },
20706
- {
20707
- name: "FIND_ANY_NOT_OF",
20718
+ "FIND_ANY_NOT_OF": {
20719
+ counter: BuiltIn.counter++,
20708
20720
  mandatory: {
20709
20721
  "val": basic_1.CLikeType.get(),
20710
20722
  },
@@ -20717,8 +20729,8 @@ BuiltIn.methods = [
20717
20729
  return: basic_1.IntegerType.get(),
20718
20730
  version: version_1.Version.v702,
20719
20731
  },
20720
- {
20721
- name: "FIND_ANY_OF",
20732
+ "FIND_ANY_OF": {
20733
+ counter: BuiltIn.counter++,
20722
20734
  mandatory: {
20723
20735
  "val": basic_1.CLikeType.get(),
20724
20736
  },
@@ -20731,8 +20743,8 @@ BuiltIn.methods = [
20731
20743
  return: basic_1.IntegerType.get(),
20732
20744
  version: version_1.Version.v702,
20733
20745
  },
20734
- {
20735
- name: "FIND_END",
20746
+ "FIND_END": {
20747
+ counter: BuiltIn.counter++,
20736
20748
  mandatory: {
20737
20749
  "val": basic_1.CLikeType.get(),
20738
20750
  },
@@ -20748,22 +20760,22 @@ BuiltIn.methods = [
20748
20760
  return: basic_1.IntegerType.get(),
20749
20761
  version: version_1.Version.v702,
20750
20762
  },
20751
- {
20752
- name: "FLOOR",
20763
+ "FLOOR": {
20764
+ counter: BuiltIn.counter++,
20753
20765
  mandatory: {
20754
20766
  "val": new basic_1.FloatType(),
20755
20767
  },
20756
20768
  return: basic_1.IntegerType.get(),
20757
20769
  },
20758
- {
20759
- name: "FRAC",
20770
+ "FRAC": {
20771
+ counter: BuiltIn.counter++,
20760
20772
  mandatory: {
20761
20773
  "val": new basic_1.FloatType(),
20762
20774
  },
20763
20775
  return: basic_1.IntegerType.get(),
20764
20776
  },
20765
- {
20766
- name: "FROM_MIXED",
20777
+ "FROM_MIXED": {
20778
+ counter: BuiltIn.counter++,
20767
20779
  mandatory: {
20768
20780
  "val": basic_1.CLikeType.get()
20769
20781
  },
@@ -20775,8 +20787,8 @@ BuiltIn.methods = [
20775
20787
  return: basic_1.StringType.get(),
20776
20788
  version: version_1.Version.v702,
20777
20789
  },
20778
- {
20779
- name: "INSERT",
20790
+ "INSERT": {
20791
+ counter: BuiltIn.counter++,
20780
20792
  mandatory: {
20781
20793
  "val": basic_1.CLikeType.get(),
20782
20794
  "sub": basic_1.CLikeType.get(),
@@ -20787,8 +20799,8 @@ BuiltIn.methods = [
20787
20799
  return: basic_1.StringType.get(),
20788
20800
  version: version_1.Version.v702,
20789
20801
  },
20790
- {
20791
- name: "IPOW",
20802
+ "IPOW": {
20803
+ counter: BuiltIn.counter++,
20792
20804
  mandatory: {
20793
20805
  "base": new basic_1.FloatType(),
20794
20806
  "exp": new basic_1.FloatType(),
@@ -20796,8 +20808,8 @@ BuiltIn.methods = [
20796
20808
  return: basic_1.IntegerType.get(),
20797
20809
  version: version_1.Version.v740sp02,
20798
20810
  },
20799
- {
20800
- name: "LINE_EXISTS",
20811
+ "LINE_EXISTS": {
20812
+ counter: BuiltIn.counter++,
20801
20813
  mandatory: {
20802
20814
  "val": new basic_1.AnyType(),
20803
20815
  },
@@ -20805,37 +20817,37 @@ BuiltIn.methods = [
20805
20817
  predicate: true,
20806
20818
  version: version_1.Version.v740sp02,
20807
20819
  },
20808
- {
20809
- name: "LINE_INDEX",
20820
+ "LINE_INDEX": {
20821
+ counter: BuiltIn.counter++,
20810
20822
  mandatory: {
20811
20823
  "val": new basic_1.AnyType(),
20812
20824
  },
20813
20825
  return: basic_1.IntegerType.get(),
20814
20826
  version: version_1.Version.v740sp02,
20815
20827
  },
20816
- {
20817
- name: "LINES",
20828
+ "LINES": {
20829
+ counter: BuiltIn.counter++,
20818
20830
  mandatory: {
20819
20831
  "val": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
20820
20832
  },
20821
20833
  return: basic_1.IntegerType.get(),
20822
20834
  },
20823
- {
20824
- name: "LOG",
20835
+ "LOG": {
20836
+ counter: BuiltIn.counter++,
20825
20837
  mandatory: {
20826
20838
  "val": new basic_1.FloatType(),
20827
20839
  },
20828
20840
  return: new basic_1.FloatType(),
20829
20841
  },
20830
- {
20831
- name: "LOG10",
20842
+ "LOG10": {
20843
+ counter: BuiltIn.counter++,
20832
20844
  mandatory: {
20833
20845
  "val": new basic_1.FloatType(),
20834
20846
  },
20835
20847
  return: new basic_1.FloatType(),
20836
20848
  },
20837
- {
20838
- name: "MATCH",
20849
+ "MATCH": {
20850
+ counter: BuiltIn.counter++,
20839
20851
  mandatory: {
20840
20852
  "val": basic_1.CLikeType.get(),
20841
20853
  }, optional: {
@@ -20847,8 +20859,8 @@ BuiltIn.methods = [
20847
20859
  return: basic_1.StringType.get(),
20848
20860
  version: version_1.Version.v702,
20849
20861
  },
20850
- {
20851
- name: "MATCHES",
20862
+ "MATCHES": {
20863
+ counter: BuiltIn.counter++,
20852
20864
  mandatory: {
20853
20865
  "val": basic_1.CLikeType.get(),
20854
20866
  },
@@ -20863,8 +20875,8 @@ BuiltIn.methods = [
20863
20875
  predicate: true,
20864
20876
  version: version_1.Version.v702,
20865
20877
  },
20866
- {
20867
- name: "NMAX",
20878
+ "NMAX": {
20879
+ counter: BuiltIn.counter++,
20868
20880
  mandatory: {
20869
20881
  "val1": basic_1.CLikeType.get(),
20870
20882
  "val2": basic_1.CLikeType.get(),
@@ -20881,8 +20893,8 @@ BuiltIn.methods = [
20881
20893
  return: basic_1.IntegerType.get(),
20882
20894
  version: version_1.Version.v702,
20883
20895
  },
20884
- {
20885
- name: "NMIN",
20896
+ "NMIN": {
20897
+ counter: BuiltIn.counter++,
20886
20898
  mandatory: {
20887
20899
  "val1": basic_1.CLikeType.get(),
20888
20900
  "val2": basic_1.CLikeType.get(),
@@ -20899,15 +20911,15 @@ BuiltIn.methods = [
20899
20911
  return: basic_1.IntegerType.get(),
20900
20912
  version: version_1.Version.v702,
20901
20913
  },
20902
- {
20903
- name: "NUMOFCHAR",
20914
+ "NUMOFCHAR": {
20915
+ counter: BuiltIn.counter++,
20904
20916
  mandatory: {
20905
20917
  "val": basic_1.CLikeType.get(),
20906
20918
  },
20907
20919
  return: basic_1.IntegerType.get(),
20908
20920
  },
20909
- {
20910
- name: "REPEAT",
20921
+ "REPEAT": {
20922
+ counter: BuiltIn.counter++,
20911
20923
  mandatory: {
20912
20924
  "val": basic_1.CLikeType.get(),
20913
20925
  "occ": basic_1.CLikeType.get(),
@@ -20915,8 +20927,8 @@ BuiltIn.methods = [
20915
20927
  return: basic_1.StringType.get(),
20916
20928
  version: version_1.Version.v702,
20917
20929
  },
20918
- {
20919
- name: "REPLACE",
20930
+ "REPLACE": {
20931
+ counter: BuiltIn.counter++,
20920
20932
  mandatory: {
20921
20933
  "val": basic_1.CLikeType.get(),
20922
20934
  "with": basic_1.CLikeType.get(),
@@ -20933,8 +20945,8 @@ BuiltIn.methods = [
20933
20945
  return: basic_1.StringType.get(),
20934
20946
  version: version_1.Version.v702,
20935
20947
  },
20936
- {
20937
- name: "RESCALE",
20948
+ "RESCALE": {
20949
+ counter: BuiltIn.counter++,
20938
20950
  mandatory: {
20939
20951
  "val": new basic_1.FloatType(),
20940
20952
  },
@@ -20946,16 +20958,16 @@ BuiltIn.methods = [
20946
20958
  return: new basic_1.FloatType(),
20947
20959
  version: version_1.Version.v702,
20948
20960
  },
20949
- {
20950
- name: "REVERSE",
20961
+ "REVERSE": {
20962
+ counter: BuiltIn.counter++,
20951
20963
  mandatory: {
20952
20964
  "val": basic_1.CLikeType.get(),
20953
20965
  },
20954
20966
  return: basic_1.StringType.get(),
20955
20967
  version: version_1.Version.v702,
20956
20968
  },
20957
- {
20958
- name: "ROUND",
20969
+ "ROUND": {
20970
+ counter: BuiltIn.counter++,
20959
20971
  mandatory: {
20960
20972
  "val": new basic_1.FloatType(),
20961
20973
  },
@@ -20967,8 +20979,8 @@ BuiltIn.methods = [
20967
20979
  return: basic_1.IntegerType.get(),
20968
20980
  version: version_1.Version.v702,
20969
20981
  },
20970
- {
20971
- name: "SEGMENT",
20982
+ "SEGMENT": {
20983
+ counter: BuiltIn.counter++,
20972
20984
  mandatory: {
20973
20985
  "val": basic_1.CLikeType.get(),
20974
20986
  "index": basic_1.IntegerType.get(),
@@ -20980,8 +20992,8 @@ BuiltIn.methods = [
20980
20992
  return: basic_1.StringType.get(),
20981
20993
  version: version_1.Version.v702,
20982
20994
  },
20983
- {
20984
- name: "SHIFT_LEFT",
20995
+ "SHIFT_LEFT": {
20996
+ counter: BuiltIn.counter++,
20985
20997
  mandatory: {
20986
20998
  "val": basic_1.CLikeType.get(),
20987
20999
  },
@@ -20993,8 +21005,8 @@ BuiltIn.methods = [
20993
21005
  return: basic_1.StringType.get(),
20994
21006
  version: version_1.Version.v702,
20995
21007
  },
20996
- {
20997
- name: "SHIFT_RIGHT",
21008
+ "SHIFT_RIGHT": {
21009
+ counter: BuiltIn.counter++,
20998
21010
  mandatory: {
20999
21011
  "val": basic_1.CLikeType.get(),
21000
21012
  },
@@ -21006,43 +21018,43 @@ BuiltIn.methods = [
21006
21018
  return: basic_1.StringType.get(),
21007
21019
  version: version_1.Version.v702,
21008
21020
  },
21009
- {
21010
- name: "SIGN",
21021
+ "SIGN": {
21022
+ counter: BuiltIn.counter++,
21011
21023
  mandatory: {
21012
21024
  "val": new basic_1.FloatType(),
21013
21025
  },
21014
21026
  return: basic_1.IntegerType.get(),
21015
21027
  },
21016
- {
21017
- name: "SIN",
21028
+ "SIN": {
21029
+ counter: BuiltIn.counter++,
21018
21030
  mandatory: {
21019
21031
  "val": new basic_1.FloatType(),
21020
21032
  },
21021
21033
  return: new basic_1.FloatType(),
21022
21034
  },
21023
- {
21024
- name: "SINH",
21035
+ "SINH": {
21036
+ counter: BuiltIn.counter++,
21025
21037
  mandatory: {
21026
21038
  "val": new basic_1.FloatType(),
21027
21039
  },
21028
21040
  return: new basic_1.FloatType(),
21029
21041
  },
21030
- {
21031
- name: "SQRT",
21042
+ "SQRT": {
21043
+ counter: BuiltIn.counter++,
21032
21044
  mandatory: {
21033
21045
  "val": new basic_1.FloatType(),
21034
21046
  },
21035
21047
  return: new basic_1.FloatType(),
21036
21048
  },
21037
- {
21038
- name: "STRLEN",
21049
+ "STRLEN": {
21050
+ counter: BuiltIn.counter++,
21039
21051
  mandatory: {
21040
21052
  "val": basic_1.CLikeType.get(),
21041
21053
  },
21042
21054
  return: basic_1.IntegerType.get(),
21043
21055
  },
21044
- {
21045
- name: "SUBSTRING",
21056
+ "SUBSTRING": {
21057
+ counter: BuiltIn.counter++,
21046
21058
  mandatory: {
21047
21059
  "val": basic_1.CLikeType.get(),
21048
21060
  },
@@ -21053,8 +21065,8 @@ BuiltIn.methods = [
21053
21065
  return: basic_1.StringType.get(),
21054
21066
  version: version_1.Version.v702,
21055
21067
  },
21056
- {
21057
- name: "SUBSTRING_AFTER",
21068
+ "SUBSTRING_AFTER": {
21069
+ counter: BuiltIn.counter++,
21058
21070
  mandatory: {
21059
21071
  "val": basic_1.CLikeType.get(),
21060
21072
  },
@@ -21069,8 +21081,8 @@ BuiltIn.methods = [
21069
21081
  return: basic_1.StringType.get(),
21070
21082
  version: version_1.Version.v702,
21071
21083
  },
21072
- {
21073
- name: "SUBSTRING_BEFORE",
21084
+ "SUBSTRING_BEFORE": {
21085
+ counter: BuiltIn.counter++,
21074
21086
  mandatory: {
21075
21087
  "val": basic_1.CLikeType.get(),
21076
21088
  },
@@ -21085,8 +21097,8 @@ BuiltIn.methods = [
21085
21097
  return: basic_1.StringType.get(),
21086
21098
  version: version_1.Version.v702,
21087
21099
  },
21088
- {
21089
- name: "SUBSTRING_FROM",
21100
+ "SUBSTRING_FROM": {
21101
+ counter: BuiltIn.counter++,
21090
21102
  mandatory: {
21091
21103
  "val": basic_1.CLikeType.get(),
21092
21104
  },
@@ -21101,8 +21113,8 @@ BuiltIn.methods = [
21101
21113
  return: basic_1.StringType.get(),
21102
21114
  version: version_1.Version.v702,
21103
21115
  },
21104
- {
21105
- name: "SUBSTRING_TO",
21116
+ "SUBSTRING_TO": {
21117
+ counter: BuiltIn.counter++,
21106
21118
  mandatory: {
21107
21119
  "val": basic_1.CLikeType.get(),
21108
21120
  },
@@ -21117,30 +21129,30 @@ BuiltIn.methods = [
21117
21129
  return: basic_1.StringType.get(),
21118
21130
  version: version_1.Version.v702,
21119
21131
  },
21120
- {
21121
- name: "TAN",
21132
+ "TAN": {
21133
+ counter: BuiltIn.counter++,
21122
21134
  mandatory: {
21123
21135
  "val": new basic_1.FloatType(),
21124
21136
  },
21125
21137
  return: new basic_1.FloatType(),
21126
21138
  },
21127
- {
21128
- name: "TANH",
21139
+ "TANH": {
21140
+ counter: BuiltIn.counter++,
21129
21141
  mandatory: {
21130
21142
  "val": new basic_1.FloatType(),
21131
21143
  },
21132
21144
  return: new basic_1.FloatType(),
21133
21145
  },
21134
- {
21135
- name: "TO_LOWER",
21146
+ "TO_LOWER": {
21147
+ counter: BuiltIn.counter++,
21136
21148
  mandatory: {
21137
21149
  "val": basic_1.CLikeType.get(),
21138
21150
  },
21139
21151
  return: basic_1.StringType.get(),
21140
21152
  version: version_1.Version.v702,
21141
21153
  },
21142
- {
21143
- name: "TO_MIXED",
21154
+ "TO_MIXED": {
21155
+ counter: BuiltIn.counter++,
21144
21156
  mandatory: {
21145
21157
  "val": basic_1.CLikeType.get(),
21146
21158
  },
@@ -21152,14 +21164,14 @@ BuiltIn.methods = [
21152
21164
  return: basic_1.StringType.get(),
21153
21165
  version: version_1.Version.v702,
21154
21166
  },
21155
- {
21156
- name: "TO_UPPER",
21167
+ "TO_UPPER": {
21168
+ counter: BuiltIn.counter++,
21157
21169
  mandatory: { "val": basic_1.CLikeType.get() },
21158
21170
  return: basic_1.StringType.get(),
21159
21171
  version: version_1.Version.v702,
21160
21172
  },
21161
- {
21162
- name: "TRANSLATE",
21173
+ "TRANSLATE": {
21174
+ counter: BuiltIn.counter++,
21163
21175
  mandatory: {
21164
21176
  "val": basic_1.CLikeType.get(),
21165
21177
  "from": basic_1.CLikeType.get(),
@@ -21168,15 +21180,15 @@ BuiltIn.methods = [
21168
21180
  return: basic_1.StringType.get(),
21169
21181
  version: version_1.Version.v702,
21170
21182
  },
21171
- {
21172
- name: "TRUNC",
21183
+ "TRUNC": {
21184
+ counter: BuiltIn.counter++,
21173
21185
  mandatory: {
21174
21186
  "val": new basic_1.FloatType(),
21175
21187
  },
21176
21188
  return: basic_1.IntegerType.get(),
21177
21189
  },
21178
- {
21179
- name: "UTCLONG_ADD",
21190
+ "UTCLONG_ADD": {
21191
+ counter: BuiltIn.counter++,
21180
21192
  mandatory: {
21181
21193
  "val": new basic_1.UTCLongType(),
21182
21194
  },
@@ -21189,13 +21201,13 @@ BuiltIn.methods = [
21189
21201
  return: new basic_1.UTCLongType(),
21190
21202
  version: version_1.Version.v754,
21191
21203
  },
21192
- {
21193
- name: "UTCLONG_CURRENT",
21204
+ "UTCLONG_CURRENT": {
21205
+ counter: BuiltIn.counter++,
21194
21206
  return: new basic_1.UTCLongType(),
21195
21207
  version: version_1.Version.v754,
21196
21208
  },
21197
- {
21198
- name: "UTCLONG_DIFF",
21209
+ "UTCLONG_DIFF": {
21210
+ counter: BuiltIn.counter++,
21199
21211
  mandatory: {
21200
21212
  "high": new basic_1.UTCLongType(),
21201
21213
  "low": new basic_1.UTCLongType(),
@@ -21203,22 +21215,22 @@ BuiltIn.methods = [
21203
21215
  return: new basic_1.FloatType(),
21204
21216
  version: version_1.Version.v754,
21205
21217
  },
21206
- {
21207
- name: "XSDBOOL",
21218
+ "XSDBOOL": {
21219
+ counter: BuiltIn.counter++,
21208
21220
  mandatory: {
21209
21221
  "val": basic_1.CLikeType.get(),
21210
21222
  },
21211
21223
  return: new basic_1.CharacterType(1),
21212
21224
  version: version_1.Version.v740sp08,
21213
21225
  },
21214
- {
21215
- name: "XSTRLEN",
21226
+ "XSTRLEN": {
21227
+ counter: BuiltIn.counter++,
21216
21228
  mandatory: {
21217
21229
  "val": new basic_1.XSequenceType(),
21218
21230
  },
21219
21231
  return: basic_1.IntegerType.get(),
21220
21232
  },
21221
- ];
21233
+ };
21222
21234
  //# sourceMappingURL=_builtin.js.map
21223
21235
 
21224
21236
  /***/ }),
@@ -21239,7 +21251,6 @@ const position_1 = __webpack_require__(/*! ../../position */ "./node_modules/@ab
21239
21251
  const spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/spaghetti_scope.js");
21240
21252
  const _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js");
21241
21253
  const _scope_type_1 = __webpack_require__(/*! ./_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
21242
- const _reference_1 = __webpack_require__(/*! ./_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
21243
21254
  const syntax_1 = __webpack_require__(/*! ./syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
21244
21255
  class CurrentScope {
21245
21256
  static buildDefault(reg, obj) {
@@ -21331,8 +21342,14 @@ class CurrentScope {
21331
21342
  this.current.getData().forms.push(...f);
21332
21343
  }
21333
21344
  addInterfaceDefinition(i) {
21334
- var _a;
21335
- (_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().idefs.push(i);
21345
+ if (this.current === undefined) {
21346
+ return;
21347
+ }
21348
+ const name = i.getName().toUpperCase();
21349
+ if (this.current.getData().cdefs[name] !== undefined) {
21350
+ throw new Error(`Interface "${name}" already defined`);
21351
+ }
21352
+ this.current.getData().idefs[name] = i;
21336
21353
  }
21337
21354
  addNamedIdentifier(name, identifier) {
21338
21355
  if (this.current === undefined) {
@@ -21427,11 +21444,10 @@ class CurrentScope {
21427
21444
  }
21428
21445
  return false;
21429
21446
  }
21430
- // todo, found + type can be removed from method output?
21431
21447
  existsObject(name) {
21432
21448
  var _a, _b, _c;
21433
21449
  if (name === undefined) {
21434
- return { found: false };
21450
+ return undefined;
21435
21451
  }
21436
21452
  let prefixRTTI = "";
21437
21453
  if (this.parentObj.getType() === "PROG") {
@@ -21445,28 +21461,28 @@ class CurrentScope {
21445
21461
  if (findLocalClass.isGlobal() === true) {
21446
21462
  prefixRTTI = "";
21447
21463
  }
21448
- return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS", RTTIName: prefixRTTI + "\\CLASS=" + findLocalClass.getName() };
21464
+ return { id: findLocalClass, ooType: "CLAS", RTTIName: prefixRTTI + "\\CLASS=" + findLocalClass.getName() };
21449
21465
  }
21450
21466
  const globalClas = this.reg.getObject("CLAS", name);
21451
21467
  if (globalClas) {
21452
- return { found: true, id: globalClas.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS", RTTIName: "\\CLASS=" + globalClas.getName() };
21468
+ return { id: globalClas.getIdentifier(), ooType: "CLAS", RTTIName: "\\CLASS=" + globalClas.getName() };
21453
21469
  }
21454
21470
  const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);
21455
21471
  if (findLocalInterface) {
21456
21472
  if (findLocalInterface.isGlobal() === true) {
21457
21473
  prefixRTTI = "";
21458
21474
  }
21459
- return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF", RTTIName: prefixRTTI + "\\INTERFACE=" + findLocalInterface.getName() };
21475
+ return { id: findLocalInterface, ooType: "INTF", RTTIName: prefixRTTI + "\\INTERFACE=" + findLocalInterface.getName() };
21460
21476
  }
21461
21477
  const globalIntf = this.reg.getObject("INTF", name);
21462
21478
  if (globalIntf) {
21463
- return { found: true, id: globalIntf.getIdentifier(), type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF", RTTIName: "\\INTERFACE=" + globalIntf.getName() };
21479
+ return { id: globalIntf.getIdentifier(), ooType: "INTF", RTTIName: "\\INTERFACE=" + globalIntf.getName() };
21464
21480
  }
21465
21481
  const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);
21466
21482
  if (def !== undefined) {
21467
- return { found: true, id: def };
21483
+ return { id: def };
21468
21484
  }
21469
- return { found: false };
21485
+ return undefined;
21470
21486
  }
21471
21487
  ///////////////////////////
21472
21488
  /** Lookup class in local and global scope */
@@ -23509,7 +23525,7 @@ class BasicTypes {
23509
23525
  else if (firstNode.get() instanceof Expressions.ClassName) {
23510
23526
  const obj = this.scope.findObjectDefinition(firstName);
23511
23527
  if (obj === undefined) {
23512
- if (this.scope.existsObject(firstName).found === true) {
23528
+ if (this.scope.existsObject(firstName) !== undefined) {
23513
23529
  return undefined;
23514
23530
  }
23515
23531
  else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {
@@ -23556,7 +23572,7 @@ class BasicTypes {
23556
23572
  return new Types.GenericObjectReferenceType();
23557
23573
  }
23558
23574
  const search = this.scope.existsObject(name);
23559
- if (search.found === true && search.id) {
23575
+ if (search === null || search === void 0 ? void 0 : search.id) {
23560
23576
  this.scope.addReference(chain.getFirstToken(), search.id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: search.ooType, ooName: name });
23561
23577
  return new Types.ObjectReferenceType(search.id, { qualifiedName: name, RTTIName: search.RTTIName });
23562
23578
  }
@@ -24732,8 +24748,8 @@ class FieldChain {
24732
24748
  return new basic_1.GenericObjectReferenceType();
24733
24749
  }
24734
24750
  const found = scope.existsObject(classNam);
24735
- if (found.found === true && found.id) {
24736
- scope.addReference(classTok, found.id, found.type, filename);
24751
+ if (found === null || found === void 0 ? void 0 : found.id) {
24752
+ scope.addReference(classTok, found.id, _reference_1.ReferenceType.ObjectOrientedReference, filename);
24737
24753
  return new basic_1.ObjectReferenceType(found.id);
24738
24754
  }
24739
24755
  else if (scope.getDDIC().inErrorNamespace(classNam) === false) {
@@ -25545,8 +25561,13 @@ class MethodCallParam {
25545
25561
  else if (child instanceof nodes_1.ExpressionNode
25546
25562
  && (child.get() instanceof Expressions.Source
25547
25563
  || child.get() instanceof Expressions.ConstantString)) {
25548
- if (!(method instanceof basic_1.VoidType) && method.getParameters().getImporting().length === 0) {
25549
- throw new Error("Method \"" + method.getName() + "\" has no importing parameters");
25564
+ if (!(method instanceof basic_1.VoidType)) {
25565
+ if (method.getParameters().getImporting().length === 0) {
25566
+ throw new Error("Method \"" + method.getName() + "\" has no importing parameters");
25567
+ }
25568
+ else if (method.getParameters().getRequiredParameters().length > 1) {
25569
+ throw new Error("Method \"" + method.getName() + "\" has more than one importing or changing parameter");
25570
+ }
25550
25571
  }
25551
25572
  let targetType = undefined;
25552
25573
  if (!(method instanceof basic_1.VoidType)) {
@@ -26116,6 +26137,12 @@ class NewObject {
26116
26137
  if (clas) {
26117
26138
  scope.addReference(typeToken, clas, _reference_1.ReferenceType.InferredType, filename);
26118
26139
  }
26140
+ else {
26141
+ const intf = scope.findInterfaceDefinition(targetType.getIdentifierName());
26142
+ if (intf) {
26143
+ throw new Error(intf.getName() + " is an interface, cannot be instantiated");
26144
+ }
26145
+ }
26119
26146
  ret = targetType;
26120
26147
  if ((clas === null || clas === void 0 ? void 0 : clas.isAbstract()) === true) {
26121
26148
  throw new Error(clas.getName() + " is abstract, cannot be instantiated");
@@ -27281,6 +27308,7 @@ const field_offset_1 = __webpack_require__(/*! ./field_offset */ "./node_modules
27281
27308
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
27282
27309
  const table_expression_1 = __webpack_require__(/*! ./table_expression */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/table_expression.js");
27283
27310
  const expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
27311
+ const field_length_1 = __webpack_require__(/*! ./field_length */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_length.js");
27284
27312
  class Target {
27285
27313
  runSyntax(node, scope, filename) {
27286
27314
  const concat = node.concatTokens();
@@ -27363,8 +27391,18 @@ class Target {
27363
27391
  }
27364
27392
  const offset = node.findDirectExpression(Expressions.FieldOffset);
27365
27393
  if (offset) {
27394
+ if (context instanceof basic_1.XStringType || context instanceof basic_1.StringType) {
27395
+ throw new Error("xstring/string offset/length in writer position not possible");
27396
+ }
27366
27397
  new field_offset_1.FieldOffset().runSyntax(offset, scope, filename);
27367
27398
  }
27399
+ const length = node.findDirectExpression(Expressions.FieldLength);
27400
+ if (length) {
27401
+ if (context instanceof basic_1.XStringType || context instanceof basic_1.StringType) {
27402
+ throw new Error("xstring/string offset/length in writer position not possible");
27403
+ }
27404
+ new field_length_1.FieldLength().runSyntax(length, scope, filename);
27405
+ }
27368
27406
  return context;
27369
27407
  }
27370
27408
  /////////////////////////////////
@@ -27750,7 +27788,7 @@ class ScopeData {
27750
27788
  this.data = {
27751
27789
  vars: {},
27752
27790
  cdefs: {},
27753
- idefs: [], // todo, refactor to object
27791
+ idefs: {},
27754
27792
  forms: [], // todo, refactor to object
27755
27793
  types: {},
27756
27794
  extraLikeTypes: {},
@@ -27852,26 +27890,13 @@ class SpaghettiScopeNode extends ScopeData {
27852
27890
  }
27853
27891
  return undefined;
27854
27892
  }
27855
- // todo, can be deleted, not called from anywhere?
27856
- listFormDefinitions() {
27857
- let search = this;
27858
- const ret = [];
27859
- while (search !== undefined) {
27860
- for (const form of search.getData().forms) {
27861
- ret.push(form);
27862
- }
27863
- search = search.getParent();
27864
- }
27865
- return ret;
27866
- }
27867
- // todo, optimize
27868
27893
  findInterfaceDefinition(name) {
27869
27894
  let search = this;
27895
+ const upper = name.toUpperCase();
27870
27896
  while (search !== undefined) {
27871
- for (const idef of search.getData().idefs) {
27872
- if (idef.getName().toUpperCase() === name.toUpperCase()) {
27873
- return idef;
27874
- }
27897
+ const idef = search.getData().idefs[upper];
27898
+ if (idef) {
27899
+ return idef;
27875
27900
  }
27876
27901
  search = search.getParent();
27877
27902
  }
@@ -27881,9 +27906,9 @@ class SpaghettiScopeNode extends ScopeData {
27881
27906
  let search = this;
27882
27907
  const upper = name.toUpperCase();
27883
27908
  while (search !== undefined) {
27884
- const data = search.getData();
27885
- if (data.types[upper]) {
27886
- return data.types[upper];
27909
+ const found = search.getData().types[upper];
27910
+ if (found) {
27911
+ return found;
27887
27912
  }
27888
27913
  search = search.getParent();
27889
27914
  }
@@ -28232,9 +28257,9 @@ class Assign {
28232
28257
  const thirdAssign = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren()[2];
28233
28258
  if ((secondAssign === null || secondAssign === void 0 ? void 0 : secondAssign.concatTokens()) === "=>" && firstAssign && (thirdAssign === null || thirdAssign === void 0 ? void 0 : thirdAssign.get()) instanceof Expressions.Dynamic) {
28234
28259
  const name = firstAssign.concatTokens();
28235
- const found = scope.findObjectDefinition(name) === undefined || scope.findVariable(name);
28236
- if (found === undefined && scope.getDDIC().inErrorNamespace(name)) {
28237
- throw new Error(secondAssign.concatTokens() + " not found");
28260
+ const found = scope.findClassDefinition(name) || scope.findVariable(name);
28261
+ if (found === undefined && scope.getDDIC().inErrorNamespace(name) && name.startsWith("(") === false) {
28262
+ throw new Error(name + " not found, dynamic");
28238
28263
  }
28239
28264
  sourceType = new basic_1.VoidType("Dynamic");
28240
28265
  }
@@ -28589,8 +28614,8 @@ class Catch {
28589
28614
  const token = c.getFirstToken();
28590
28615
  const className = token.getStr().toUpperCase();
28591
28616
  const found = scope.existsObject(className);
28592
- if (found.found === true && found.id) {
28593
- scope.addReference(token, found.id, found.type, filename);
28617
+ if (found === null || found === void 0 ? void 0 : found.id) {
28618
+ scope.addReference(token, found.id, _reference_1.ReferenceType.ObjectOrientedReference, filename);
28594
28619
  }
28595
28620
  else if (scope.getDDIC().inErrorNamespace(className) === false) {
28596
28621
  const extra = { ooName: className, ooType: "Void" };
@@ -28609,7 +28634,7 @@ class Catch {
28609
28634
  if (target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData)) {
28610
28635
  const token = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.getFirstToken();
28611
28636
  const found = scope.existsObject(firstClassName);
28612
- if (token && found.found === true && firstClassName && found.id) {
28637
+ if (token && firstClassName && (found === null || found === void 0 ? void 0 : found.id)) {
28613
28638
  const identifier = new _typed_identifier_1.TypedIdentifier(token, filename, new basic_1.ObjectReferenceType(found.id), ["inline" /* IdentifierMeta.InlineDefinition */]);
28614
28639
  scope.addIdentifier(identifier);
28615
28640
  scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, filename);
@@ -28812,7 +28837,7 @@ class ClassLocalFriends {
28812
28837
  const className = classNames[i].concatTokens();
28813
28838
  // make sure to check also DEFINITION DEFERRED
28814
28839
  const found = scope.existsObject(className);
28815
- if (found.found === false) {
28840
+ if (found === undefined) {
28816
28841
  throw new Error(`Class ${className.toUpperCase()} not found`);
28817
28842
  }
28818
28843
  }
@@ -31242,8 +31267,8 @@ class Raise {
31242
31267
  const className = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
31243
31268
  if (className) {
31244
31269
  const found = scope.existsObject(className);
31245
- if (found.found === true && found.id) {
31246
- scope.addReference(classTok, found.id, found.type, filename);
31270
+ if (found === null || found === void 0 ? void 0 : found.id) {
31271
+ scope.addReference(classTok, found.id, _reference_1.ReferenceType.ObjectOrientedReference, filename);
31247
31272
  const def = scope.findObjectDefinition(className);
31248
31273
  method = (_b = helper.searchMethodName(def, "CONSTRUCTOR")) === null || _b === void 0 ? void 0 : _b.method;
31249
31274
  }
@@ -36792,8 +36817,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
36792
36817
  exports.VoidType = void 0;
36793
36818
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
36794
36819
  class VoidType extends _abstract_type_1.AbstractType {
36795
- constructor(voided, name) {
36796
- super({ qualifiedName: name });
36820
+ constructor(voided, qualifiedName) {
36821
+ super({ qualifiedName: qualifiedName });
36797
36822
  this.voided = voided;
36798
36823
  }
36799
36824
  getVoided() {
@@ -47303,8 +47328,9 @@ class NeptuneAPI extends _abstract_object_1.AbstractObject {
47303
47328
  }
47304
47329
  getAllowedNaming() {
47305
47330
  return {
47306
- maxLength: 30,
47331
+ maxLength: 100,
47307
47332
  allowNamespace: true,
47333
+ customRegex: /.*/i,
47308
47334
  };
47309
47335
  }
47310
47336
  getDescription() {
@@ -51080,7 +51106,7 @@ class Registry {
51080
51106
  }
51081
51107
  static abaplintVersion() {
51082
51108
  // magic, see build script "version.sh"
51083
- return "2.105.4";
51109
+ return "2.105.6";
51084
51110
  }
51085
51111
  getDDICReferences() {
51086
51112
  return this.ddicReferences;
@@ -51588,6 +51614,8 @@ class AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {
51588
51614
  this.checkLocal = false;
51589
51615
  this.classDefinition = false;
51590
51616
  this.interfaceDefinition = false;
51617
+ /** Ignores classes flagged as FOR TESTING */
51618
+ this.ignoreTestClasses = true;
51591
51619
  }
51592
51620
  }
51593
51621
  exports.AbapdocConf = AbapdocConf;
@@ -51627,8 +51655,11 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
51627
51655
  if (this.conf.checkLocal === false && classDef.isLocal === true) {
51628
51656
  continue;
51629
51657
  }
51658
+ if (this.conf.ignoreTestClasses === true && classDef.isForTesting === true) {
51659
+ continue;
51660
+ }
51630
51661
  methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));
51631
- if (this.getConfig().classDefinition === true) {
51662
+ if (this.conf.classDefinition === true) {
51632
51663
  const previousRow = classDef.identifier.getStart().getRow() - 2;
51633
51664
  if (((_a = rows[previousRow]) === null || _a === void 0 ? void 0 : _a.trim().substring(0, 2)) !== "\"!") {
51634
51665
  const message = "Missing ABAP Doc for class " + classDef.identifier.getToken().getStr();
@@ -51642,7 +51673,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
51642
51673
  continue;
51643
51674
  }
51644
51675
  methods = methods.concat(interfaceDef.methods);
51645
- if (this.getConfig().interfaceDefinition === true) {
51676
+ if (this.conf.interfaceDefinition === true) {
51646
51677
  const previousRow = interfaceDef.identifier.getStart().getRow() - 2;
51647
51678
  if (((_b = rows[previousRow]) === null || _b === void 0 ? void 0 : _b.trim().substring(0, 2)) !== "\"!") {
51648
51679
  const message = "Missing ABAP Doc for interface " + interfaceDef.identifier.getToken().getStr();
@@ -52106,6 +52137,7 @@ exports.AllowedObjectNaming = exports.AllowedObjectNamingConf = void 0;
52106
52137
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
52107
52138
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
52108
52139
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
52140
+ const NAME_REGEX = /^(\/[A-Z_\d]{3,8}\/)?[A-Z_\d<> ]+$/i;
52109
52141
  class AllowedObjectNamingConf extends _basic_rule_config_1.BasicRuleConfig {
52110
52142
  }
52111
52143
  exports.AllowedObjectNamingConf = AllowedObjectNamingConf;
@@ -52145,7 +52177,7 @@ class AllowedObjectNaming {
52145
52177
  message = "Name not allowed";
52146
52178
  }
52147
52179
  }
52148
- else if (name.match(/^(\/[A-Z_\d]{3,8}\/)?[A-Z_\d<> ]+$/i) === null) {
52180
+ else if (name.match(NAME_REGEX) === null) {
52149
52181
  message = "Name not allowed";
52150
52182
  }
52151
52183
  if (message.length > 0) {
@@ -60282,8 +60314,8 @@ class Conditions {
60282
60314
  push(e) {
60283
60315
  this.arr.push(e.concatTokens());
60284
60316
  }
60285
- hasDuplicates() {
60286
- return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));
60317
+ findFirstDuplicate() {
60318
+ return this.arr.find(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));
60287
60319
  }
60288
60320
  }
60289
60321
  class IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {
@@ -60342,8 +60374,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60342
60374
  return [];
60343
60375
  }
60344
60376
  }
60345
- if (conditions.hasDuplicates()) {
60346
- const message = "Identical conditions";
60377
+ const duplicate = conditions.findFirstDuplicate();
60378
+ if (duplicate) {
60379
+ const message = "Identical conditions: " + duplicate;
60347
60380
  const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
60348
60381
  return [issue];
60349
60382
  }
@@ -60366,8 +60399,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60366
60399
  conditions.push(c);
60367
60400
  }
60368
60401
  }
60369
- if (conditions.hasDuplicates()) {
60370
- const message = "Identical conditions";
60402
+ const duplicate = conditions.findFirstDuplicate();
60403
+ if (duplicate) {
60404
+ const message = "Identical conditions: " + duplicate;
60371
60405
  const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);
60372
60406
  return [issue];
60373
60407
  }
@@ -60388,8 +60422,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60388
60422
  conditions.push(s);
60389
60423
  }
60390
60424
  }
60391
- if (conditions.hasDuplicates()) {
60392
- const message = "Identical conditions";
60425
+ const duplicate = conditions.findFirstDuplicate();
60426
+ if (duplicate) {
60427
+ const message = "Identical conditions: " + duplicate;
60393
60428
  const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);
60394
60429
  return [issue];
60395
60430
  }
@@ -70392,7 +70427,8 @@ class UnknownTypes {
70392
70427
  }
70393
70428
  }
70394
70429
  }
70395
- for (const v of nodeData.idefs) {
70430
+ for (const name in nodeData.idefs) {
70431
+ const v = nodeData.idefs[name];
70396
70432
  const found = this.checkParameters(v);
70397
70433
  if (found) {
70398
70434
  const message = "Contains unknown, " + found.found;
@@ -86531,6 +86567,7 @@ const arg = {
86531
86567
  runRename: parsed["rename"],
86532
86568
  outFormat: parsed["outformat"],
86533
86569
  outFile: parsed["outfile"],
86570
+ file: parsed["file"],
86534
86571
  };
86535
86572
  (0, _1.run)(arg).then(({ output, issues }) => {
86536
86573
  if (output.length > 0) {