@abaplint/transpiler-cli 2.6.44 → 2.7.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.
Files changed (2) hide show
  1. package/build/bundle.js +430 -161
  2. package/package.json +5 -4
package/build/bundle.js CHANGED
@@ -7847,6 +7847,7 @@ class StatementParser {
7847
7847
  const concat = statement.concatTokens().toUpperCase();
7848
7848
  if (concat.startsWith("CALL METHOD ") === false
7849
7849
  && concat.startsWith("RAISE EXCEPTION TYPE ") === false
7850
+ && concat.startsWith("READ TABLE ") === false
7850
7851
  && concat.startsWith("LOOP AT ") === false
7851
7852
  && concat.startsWith("CALL FUNCTION ") === false) {
7852
7853
  for (const { first, second } of this.buildSplits(statement.getTokens())) {
@@ -18622,7 +18623,7 @@ BuiltIn.methods = [
18622
18623
  {
18623
18624
  name: "BOOLC",
18624
18625
  mandatory: {
18625
- "val": new basic_1.StringType(),
18626
+ "val": new basic_1.CLikeType(),
18626
18627
  },
18627
18628
  return: new basic_1.StringType(),
18628
18629
  version: version_1.Version.v702,
@@ -18630,7 +18631,7 @@ BuiltIn.methods = [
18630
18631
  {
18631
18632
  name: "BOOLX",
18632
18633
  mandatory: {
18633
- "bool": new basic_1.StringType(),
18634
+ "bool": new basic_1.CLikeType(),
18634
18635
  },
18635
18636
  optional: {
18636
18637
  "bit": new basic_1.IntegerType(),
@@ -18648,7 +18649,7 @@ BuiltIn.methods = [
18648
18649
  {
18649
18650
  name: "CHAR_OFF",
18650
18651
  mandatory: {
18651
- "val": new basic_1.StringType(),
18652
+ "val": new basic_1.CLikeType(),
18652
18653
  "add": new basic_1.IntegerType(),
18653
18654
  },
18654
18655
  optional: {
@@ -18660,23 +18661,23 @@ BuiltIn.methods = [
18660
18661
  {
18661
18662
  name: "CHARLEN",
18662
18663
  mandatory: {
18663
- "val": new basic_1.StringType(),
18664
+ "val": new basic_1.CLikeType(),
18664
18665
  },
18665
18666
  return: new basic_1.IntegerType(),
18666
18667
  },
18667
18668
  {
18668
18669
  name: "CMAX",
18669
18670
  mandatory: {
18670
- "val1": new basic_1.StringType(),
18671
- "val2": new basic_1.StringType(),
18671
+ "val1": new basic_1.CLikeType(),
18672
+ "val2": new basic_1.CLikeType(),
18672
18673
  },
18673
18674
  optional: {
18674
- "val3": new basic_1.StringType(),
18675
- "val4": new basic_1.StringType(),
18676
- "val5": new basic_1.StringType(),
18677
- "val6": new basic_1.StringType(),
18678
- "val7": new basic_1.StringType(),
18679
- "val9": new basic_1.StringType(),
18675
+ "val3": new basic_1.CLikeType(),
18676
+ "val4": new basic_1.CLikeType(),
18677
+ "val5": new basic_1.CLikeType(),
18678
+ "val6": new basic_1.CLikeType(),
18679
+ "val7": new basic_1.CLikeType(),
18680
+ "val9": new basic_1.CLikeType(),
18680
18681
  },
18681
18682
  return: new basic_1.StringType(),
18682
18683
  version: version_1.Version.v702,
@@ -18684,16 +18685,16 @@ BuiltIn.methods = [
18684
18685
  {
18685
18686
  name: "CMIN",
18686
18687
  mandatory: {
18687
- "val1": new basic_1.StringType(),
18688
- "val2": new basic_1.StringType(),
18688
+ "val1": new basic_1.CLikeType(),
18689
+ "val2": new basic_1.CLikeType(),
18689
18690
  },
18690
18691
  optional: {
18691
- "val3": new basic_1.StringType(),
18692
- "val4": new basic_1.StringType(),
18693
- "val5": new basic_1.StringType(),
18694
- "val6": new basic_1.StringType(),
18695
- "val7": new basic_1.StringType(),
18696
- "val9": new basic_1.StringType(),
18692
+ "val3": new basic_1.CLikeType(),
18693
+ "val4": new basic_1.CLikeType(),
18694
+ "val5": new basic_1.CLikeType(),
18695
+ "val6": new basic_1.CLikeType(),
18696
+ "val7": new basic_1.CLikeType(),
18697
+ "val9": new basic_1.CLikeType(),
18697
18698
  },
18698
18699
  return: new basic_1.StringType(),
18699
18700
  version: version_1.Version.v702,
@@ -18704,7 +18705,7 @@ BuiltIn.methods = [
18704
18705
  "table": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
18705
18706
  },
18706
18707
  optional: {
18707
- "sep": new basic_1.StringType(),
18708
+ "sep": new basic_1.CLikeType(),
18708
18709
  },
18709
18710
  return: new basic_1.StringType(),
18710
18711
  version: version_1.Version.v702,
@@ -18712,12 +18713,12 @@ BuiltIn.methods = [
18712
18713
  {
18713
18714
  name: "CONDENSE",
18714
18715
  mandatory: {
18715
- "val": new basic_1.StringType(),
18716
+ "val": new basic_1.CLikeType(),
18716
18717
  },
18717
18718
  optional: {
18718
- "del": new basic_1.StringType(),
18719
- "from": new basic_1.StringType(),
18720
- "to": new basic_1.StringType(),
18719
+ "del": new basic_1.CLikeType(),
18720
+ "from": new basic_1.CLikeType(),
18721
+ "to": new basic_1.CLikeType(),
18721
18722
  },
18722
18723
  return: new basic_1.StringType(),
18723
18724
  version: version_1.Version.v702,
@@ -18725,14 +18726,14 @@ BuiltIn.methods = [
18725
18726
  {
18726
18727
  name: "CONTAINS",
18727
18728
  mandatory: {
18728
- "val": new basic_1.StringType(),
18729
+ "val": new basic_1.CLikeType(),
18729
18730
  },
18730
18731
  optional: {
18731
- "sub": new basic_1.StringType(),
18732
- "start": new basic_1.StringType(),
18733
- "end": new basic_1.StringType(),
18734
- "regex": new basic_1.StringType(),
18735
- "pcre": new basic_1.StringType(),
18732
+ "sub": new basic_1.CLikeType(),
18733
+ "start": new basic_1.CLikeType(),
18734
+ "end": new basic_1.CLikeType(),
18735
+ "regex": new basic_1.CLikeType(),
18736
+ "pcre": new basic_1.CLikeType(),
18736
18737
  "case": new basic_1.CharacterType(1),
18737
18738
  "off": new basic_1.IntegerType(),
18738
18739
  "len": new basic_1.IntegerType(),
@@ -18745,12 +18746,12 @@ BuiltIn.methods = [
18745
18746
  {
18746
18747
  name: "CONTAINS_ANY_NOT_OF",
18747
18748
  mandatory: {
18748
- "val": new basic_1.StringType(),
18749
+ "val": new basic_1.CLikeType(),
18749
18750
  },
18750
18751
  optional: {
18751
- "sub": new basic_1.StringType(),
18752
- "start": new basic_1.StringType(),
18753
- "end": new basic_1.StringType(),
18752
+ "sub": new basic_1.CLikeType(),
18753
+ "start": new basic_1.CLikeType(),
18754
+ "end": new basic_1.CLikeType(),
18754
18755
  "off": new basic_1.IntegerType(),
18755
18756
  "len": new basic_1.IntegerType(),
18756
18757
  "occ": new basic_1.IntegerType(),
@@ -18761,12 +18762,12 @@ BuiltIn.methods = [
18761
18762
  {
18762
18763
  name: "CONTAINS_ANY_OF",
18763
18764
  mandatory: {
18764
- "val": new basic_1.StringType(),
18765
+ "val": new basic_1.CLikeType(),
18765
18766
  },
18766
18767
  optional: {
18767
- "sub": new basic_1.StringType(),
18768
- "start": new basic_1.StringType(),
18769
- "end": new basic_1.StringType(),
18768
+ "sub": new basic_1.CLikeType(),
18769
+ "start": new basic_1.CLikeType(),
18770
+ "end": new basic_1.CLikeType(),
18770
18771
  "off": new basic_1.IntegerType(),
18771
18772
  "len": new basic_1.IntegerType(),
18772
18773
  "occ": new basic_1.IntegerType(),
@@ -18792,12 +18793,12 @@ BuiltIn.methods = [
18792
18793
  {
18793
18794
  name: "COUNT",
18794
18795
  mandatory: {
18795
- "val": new basic_1.StringType(),
18796
+ "val": new basic_1.CLikeType(),
18796
18797
  },
18797
18798
  optional: {
18798
- "sub": new basic_1.StringType(),
18799
- "regex": new basic_1.StringType(),
18800
- "pcre": new basic_1.StringType(),
18799
+ "sub": new basic_1.CLikeType(),
18800
+ "regex": new basic_1.CLikeType(),
18801
+ "pcre": new basic_1.CLikeType(),
18801
18802
  "case": new basic_1.CharacterType(1),
18802
18803
  "off": new basic_1.IntegerType(),
18803
18804
  "len": new basic_1.IntegerType(),
@@ -18808,12 +18809,12 @@ BuiltIn.methods = [
18808
18809
  {
18809
18810
  name: "COUNT_ANY_NOT_OF",
18810
18811
  mandatory: {
18811
- "val": new basic_1.StringType(),
18812
+ "val": new basic_1.CLikeType(),
18812
18813
  },
18813
18814
  optional: {
18814
- "sub": new basic_1.StringType(),
18815
- "regex": new basic_1.StringType(),
18816
- "pcre": new basic_1.StringType(),
18815
+ "sub": new basic_1.CLikeType(),
18816
+ "regex": new basic_1.CLikeType(),
18817
+ "pcre": new basic_1.CLikeType(),
18817
18818
  "case": new basic_1.CharacterType(1),
18818
18819
  "off": new basic_1.IntegerType(),
18819
18820
  "len": new basic_1.IntegerType(),
@@ -18824,12 +18825,12 @@ BuiltIn.methods = [
18824
18825
  {
18825
18826
  name: "COUNT_ANY_OF",
18826
18827
  mandatory: {
18827
- "val": new basic_1.StringType(),
18828
+ "val": new basic_1.CLikeType(),
18828
18829
  },
18829
18830
  optional: {
18830
- "sub": new basic_1.StringType(),
18831
- "regex": new basic_1.StringType(),
18832
- "pcre": new basic_1.StringType(),
18831
+ "sub": new basic_1.CLikeType(),
18832
+ "regex": new basic_1.CLikeType(),
18833
+ "pcre": new basic_1.CLikeType(),
18833
18834
  "case": new basic_1.CharacterType(1),
18834
18835
  "off": new basic_1.IntegerType(),
18835
18836
  "len": new basic_1.IntegerType(),
@@ -18840,15 +18841,15 @@ BuiltIn.methods = [
18840
18841
  {
18841
18842
  name: "DBMAXLEN",
18842
18843
  mandatory: {
18843
- "val": new basic_1.StringType(),
18844
+ "val": new basic_1.CLikeType(),
18844
18845
  },
18845
18846
  return: new basic_1.IntegerType(),
18846
18847
  },
18847
18848
  {
18848
18849
  name: "DISTANCE",
18849
18850
  mandatory: {
18850
- "val1": new basic_1.StringType(),
18851
- "val2": new basic_1.StringType(),
18851
+ "val1": new basic_1.CLikeType(),
18852
+ "val2": new basic_1.CLikeType(),
18852
18853
  },
18853
18854
  return: new basic_1.IntegerType(),
18854
18855
  version: version_1.Version.v702,
@@ -18856,8 +18857,8 @@ BuiltIn.methods = [
18856
18857
  {
18857
18858
  name: "ESCAPE",
18858
18859
  mandatory: {
18859
- "val": new basic_1.StringType(),
18860
- "format": new basic_1.StringType(),
18860
+ "val": new basic_1.CLikeType(),
18861
+ "format": new basic_1.CLikeType(),
18861
18862
  },
18862
18863
  return: new basic_1.StringType(),
18863
18864
  version: version_1.Version.v702,
@@ -18872,12 +18873,12 @@ BuiltIn.methods = [
18872
18873
  {
18873
18874
  name: "FIND",
18874
18875
  mandatory: {
18875
- "val": new basic_1.StringType(),
18876
+ "val": new basic_1.CLikeType(),
18876
18877
  },
18877
18878
  optional: {
18878
- "sub": new basic_1.StringType(),
18879
- "regex": new basic_1.StringType(),
18880
- "pcre": new basic_1.StringType(),
18879
+ "sub": new basic_1.CLikeType(),
18880
+ "regex": new basic_1.CLikeType(),
18881
+ "pcre": new basic_1.CLikeType(),
18881
18882
  "case": new basic_1.CharacterType(1),
18882
18883
  "off": new basic_1.IntegerType(),
18883
18884
  "len": new basic_1.IntegerType(),
@@ -18889,10 +18890,10 @@ BuiltIn.methods = [
18889
18890
  {
18890
18891
  name: "FIND_ANY_NOT_OF",
18891
18892
  mandatory: {
18892
- "val": new basic_1.StringType(),
18893
+ "val": new basic_1.CLikeType(),
18893
18894
  },
18894
18895
  optional: {
18895
- "sub": new basic_1.StringType(),
18896
+ "sub": new basic_1.CLikeType(),
18896
18897
  "off": new basic_1.IntegerType(),
18897
18898
  "len": new basic_1.IntegerType(),
18898
18899
  "occ": new basic_1.IntegerType(),
@@ -18903,10 +18904,10 @@ BuiltIn.methods = [
18903
18904
  {
18904
18905
  name: "FIND_ANY_OF",
18905
18906
  mandatory: {
18906
- "val": new basic_1.StringType(),
18907
+ "val": new basic_1.CLikeType(),
18907
18908
  },
18908
18909
  optional: {
18909
- "sub": new basic_1.StringType(),
18910
+ "sub": new basic_1.CLikeType(),
18910
18911
  "off": new basic_1.IntegerType(),
18911
18912
  "len": new basic_1.IntegerType(),
18912
18913
  "occ": new basic_1.IntegerType(),
@@ -18917,12 +18918,12 @@ BuiltIn.methods = [
18917
18918
  {
18918
18919
  name: "FIND_END",
18919
18920
  mandatory: {
18920
- "val": new basic_1.StringType(),
18921
+ "val": new basic_1.CLikeType(),
18921
18922
  },
18922
18923
  optional: {
18923
- "sub": new basic_1.StringType(),
18924
- "regex": new basic_1.StringType(),
18925
- "pcre": new basic_1.StringType(),
18924
+ "sub": new basic_1.CLikeType(),
18925
+ "regex": new basic_1.CLikeType(),
18926
+ "pcre": new basic_1.CLikeType(),
18926
18927
  "case": new basic_1.CharacterType(1),
18927
18928
  "off": new basic_1.IntegerType(),
18928
18929
  "len": new basic_1.IntegerType(),
@@ -18947,7 +18948,9 @@ BuiltIn.methods = [
18947
18948
  },
18948
18949
  {
18949
18950
  name: "FROM_MIXED",
18950
- mandatory: { "val": new basic_1.StringType() },
18951
+ mandatory: {
18952
+ "val": new basic_1.CLikeType()
18953
+ },
18951
18954
  optional: {
18952
18955
  "case": new basic_1.CharacterType(1),
18953
18956
  "sep": new basic_1.IntegerType(),
@@ -18959,8 +18962,8 @@ BuiltIn.methods = [
18959
18962
  {
18960
18963
  name: "INSERT",
18961
18964
  mandatory: {
18962
- "val": new basic_1.StringType(),
18963
- "sub": new basic_1.StringType(),
18965
+ "val": new basic_1.CLikeType(),
18966
+ "sub": new basic_1.CLikeType(),
18964
18967
  },
18965
18968
  optional: {
18966
18969
  "off": new basic_1.IntegerType(),
@@ -18989,7 +18992,7 @@ BuiltIn.methods = [
18989
18992
  {
18990
18993
  name: "LINE_INDEX",
18991
18994
  mandatory: {
18992
- "val": new basic_1.StringType(),
18995
+ "val": new basic_1.CLikeType(),
18993
18996
  },
18994
18997
  return: new basic_1.IntegerType(),
18995
18998
  version: version_1.Version.v740sp02,
@@ -19018,11 +19021,11 @@ BuiltIn.methods = [
19018
19021
  {
19019
19022
  name: "MATCH",
19020
19023
  mandatory: {
19021
- "val": new basic_1.StringType(),
19024
+ "val": new basic_1.CLikeType(),
19022
19025
  }, optional: {
19023
19026
  "case": new basic_1.CharacterType(1),
19024
- "regex": new basic_1.StringType(),
19025
- "pcre": new basic_1.StringType(),
19027
+ "regex": new basic_1.CLikeType(),
19028
+ "pcre": new basic_1.CLikeType(),
19026
19029
  "occ": new basic_1.IntegerType(),
19027
19030
  },
19028
19031
  return: new basic_1.StringType(),
@@ -19031,12 +19034,12 @@ BuiltIn.methods = [
19031
19034
  {
19032
19035
  name: "MATCHES",
19033
19036
  mandatory: {
19034
- "val": new basic_1.StringType(),
19037
+ "val": new basic_1.CLikeType(),
19035
19038
  },
19036
19039
  optional: {
19037
19040
  "case": new basic_1.CharacterType(1),
19038
- "regex": new basic_1.StringType(),
19039
- "pcre": new basic_1.StringType(),
19041
+ "regex": new basic_1.CLikeType(),
19042
+ "pcre": new basic_1.CLikeType(),
19040
19043
  "off": new basic_1.IntegerType(),
19041
19044
  "len": new basic_1.IntegerType(),
19042
19045
  },
@@ -19047,17 +19050,17 @@ BuiltIn.methods = [
19047
19050
  {
19048
19051
  name: "NMAX",
19049
19052
  mandatory: {
19050
- "val1": new basic_1.StringType(),
19051
- "val2": new basic_1.StringType(),
19053
+ "val1": new basic_1.CLikeType(),
19054
+ "val2": new basic_1.CLikeType(),
19052
19055
  },
19053
19056
  optional: {
19054
- "val3": new basic_1.StringType(),
19055
- "val4": new basic_1.StringType(),
19056
- "val5": new basic_1.StringType(),
19057
- "val6": new basic_1.StringType(),
19058
- "val7": new basic_1.StringType(),
19059
- "val8": new basic_1.StringType(),
19060
- "val9": new basic_1.StringType(),
19057
+ "val3": new basic_1.CLikeType(),
19058
+ "val4": new basic_1.CLikeType(),
19059
+ "val5": new basic_1.CLikeType(),
19060
+ "val6": new basic_1.CLikeType(),
19061
+ "val7": new basic_1.CLikeType(),
19062
+ "val8": new basic_1.CLikeType(),
19063
+ "val9": new basic_1.CLikeType(),
19061
19064
  },
19062
19065
  return: new basic_1.IntegerType(),
19063
19066
  version: version_1.Version.v702,
@@ -19065,17 +19068,17 @@ BuiltIn.methods = [
19065
19068
  {
19066
19069
  name: "NMIN",
19067
19070
  mandatory: {
19068
- "val1": new basic_1.StringType(),
19069
- "val2": new basic_1.StringType(),
19071
+ "val1": new basic_1.CLikeType(),
19072
+ "val2": new basic_1.CLikeType(),
19070
19073
  },
19071
19074
  optional: {
19072
- "val3": new basic_1.StringType(),
19073
- "val4": new basic_1.StringType(),
19074
- "val5": new basic_1.StringType(),
19075
- "val6": new basic_1.StringType(),
19076
- "val7": new basic_1.StringType(),
19077
- "val8": new basic_1.StringType(),
19078
- "val9": new basic_1.StringType(),
19075
+ "val3": new basic_1.CLikeType(),
19076
+ "val4": new basic_1.CLikeType(),
19077
+ "val5": new basic_1.CLikeType(),
19078
+ "val6": new basic_1.CLikeType(),
19079
+ "val7": new basic_1.CLikeType(),
19080
+ "val8": new basic_1.CLikeType(),
19081
+ "val9": new basic_1.CLikeType(),
19079
19082
  },
19080
19083
  return: new basic_1.IntegerType(),
19081
19084
  version: version_1.Version.v702,
@@ -19083,14 +19086,14 @@ BuiltIn.methods = [
19083
19086
  {
19084
19087
  name: "NUMOFCHAR",
19085
19088
  mandatory: {
19086
- "val": new basic_1.StringType(),
19089
+ "val": new basic_1.CLikeType(),
19087
19090
  },
19088
19091
  return: new basic_1.IntegerType(),
19089
19092
  },
19090
19093
  {
19091
19094
  name: "REPEAT",
19092
19095
  mandatory: {
19093
- "val": new basic_1.StringType(),
19096
+ "val": new basic_1.CLikeType(),
19094
19097
  "occ": new basic_1.IntegerType(),
19095
19098
  },
19096
19099
  return: new basic_1.StringType(),
@@ -19099,13 +19102,13 @@ BuiltIn.methods = [
19099
19102
  {
19100
19103
  name: "REPLACE",
19101
19104
  mandatory: {
19102
- "val": new basic_1.StringType(),
19103
- "with": new basic_1.StringType(),
19105
+ "val": new basic_1.CLikeType(),
19106
+ "with": new basic_1.CLikeType(),
19104
19107
  },
19105
19108
  optional: {
19106
- "sub": new basic_1.StringType(),
19107
- "regex": new basic_1.StringType(),
19108
- "pcre": new basic_1.StringType(),
19109
+ "sub": new basic_1.CLikeType(),
19110
+ "regex": new basic_1.CLikeType(),
19111
+ "pcre": new basic_1.CLikeType(),
19109
19112
  "case": new basic_1.CharacterType(1),
19110
19113
  "off": new basic_1.IntegerType(),
19111
19114
  "len": new basic_1.IntegerType(),
@@ -19130,7 +19133,7 @@ BuiltIn.methods = [
19130
19133
  {
19131
19134
  name: "REVERSE",
19132
19135
  mandatory: {
19133
- "val": new basic_1.StringType(),
19136
+ "val": new basic_1.CLikeType(),
19134
19137
  },
19135
19138
  return: new basic_1.StringType(),
19136
19139
  version: version_1.Version.v702,
@@ -19151,12 +19154,12 @@ BuiltIn.methods = [
19151
19154
  {
19152
19155
  name: "SEGMENT",
19153
19156
  mandatory: {
19154
- "val": new basic_1.StringType(),
19157
+ "val": new basic_1.CLikeType(),
19155
19158
  "index": new basic_1.IntegerType(),
19156
19159
  },
19157
19160
  optional: {
19158
- "sep": new basic_1.StringType(),
19159
- "space": new basic_1.StringType(),
19161
+ "sep": new basic_1.CLikeType(),
19162
+ "space": new basic_1.CLikeType(),
19160
19163
  },
19161
19164
  return: new basic_1.StringType(),
19162
19165
  version: version_1.Version.v702,
@@ -19164,10 +19167,10 @@ BuiltIn.methods = [
19164
19167
  {
19165
19168
  name: "SHIFT_LEFT",
19166
19169
  mandatory: {
19167
- "val": new basic_1.StringType(),
19170
+ "val": new basic_1.CLikeType(),
19168
19171
  },
19169
19172
  optional: {
19170
- "sub": new basic_1.StringType(),
19173
+ "sub": new basic_1.CLikeType(),
19171
19174
  "places": new basic_1.IntegerType(),
19172
19175
  "circular": new basic_1.IntegerType(),
19173
19176
  },
@@ -19177,10 +19180,10 @@ BuiltIn.methods = [
19177
19180
  {
19178
19181
  name: "SHIFT_RIGHT",
19179
19182
  mandatory: {
19180
- "val": new basic_1.StringType(),
19183
+ "val": new basic_1.CLikeType(),
19181
19184
  },
19182
19185
  optional: {
19183
- "sub": new basic_1.StringType(),
19186
+ "sub": new basic_1.CLikeType(),
19184
19187
  "places": new basic_1.IntegerType(),
19185
19188
  "circular": new basic_1.IntegerType(),
19186
19189
  },
@@ -19240,9 +19243,9 @@ BuiltIn.methods = [
19240
19243
  "val": new basic_1.CLikeType(),
19241
19244
  },
19242
19245
  optional: {
19243
- "sub": new basic_1.StringType(),
19244
- "regex": new basic_1.StringType(),
19245
- "pcre": new basic_1.StringType(),
19246
+ "sub": new basic_1.CLikeType(),
19247
+ "regex": new basic_1.CLikeType(),
19248
+ "pcre": new basic_1.CLikeType(),
19246
19249
  "case": new basic_1.CharacterType(1),
19247
19250
  "len": new basic_1.IntegerType(),
19248
19251
  "occ": new basic_1.IntegerType(),
@@ -19256,9 +19259,9 @@ BuiltIn.methods = [
19256
19259
  "val": new basic_1.CLikeType(),
19257
19260
  },
19258
19261
  optional: {
19259
- "sub": new basic_1.StringType(),
19260
- "regex": new basic_1.StringType(),
19261
- "pcre": new basic_1.StringType(),
19262
+ "sub": new basic_1.CLikeType(),
19263
+ "regex": new basic_1.CLikeType(),
19264
+ "pcre": new basic_1.CLikeType(),
19262
19265
  "case": new basic_1.CharacterType(1),
19263
19266
  "len": new basic_1.IntegerType(),
19264
19267
  "occ": new basic_1.IntegerType(),
@@ -19272,9 +19275,9 @@ BuiltIn.methods = [
19272
19275
  "val": new basic_1.CLikeType(),
19273
19276
  },
19274
19277
  optional: {
19275
- "sub": new basic_1.StringType(),
19276
- "regex": new basic_1.StringType(),
19277
- "pcre": new basic_1.StringType(),
19278
+ "sub": new basic_1.CLikeType(),
19279
+ "regex": new basic_1.CLikeType(),
19280
+ "pcre": new basic_1.CLikeType(),
19278
19281
  "case": new basic_1.CharacterType(1),
19279
19282
  "len": new basic_1.IntegerType(),
19280
19283
  "occ": new basic_1.IntegerType(),
@@ -19288,9 +19291,9 @@ BuiltIn.methods = [
19288
19291
  "val": new basic_1.CLikeType(),
19289
19292
  },
19290
19293
  optional: {
19291
- "sub": new basic_1.StringType(),
19292
- "regex": new basic_1.StringType(),
19293
- "pcre": new basic_1.StringType(),
19294
+ "sub": new basic_1.CLikeType(),
19295
+ "regex": new basic_1.CLikeType(),
19296
+ "pcre": new basic_1.CLikeType(),
19294
19297
  "case": new basic_1.CharacterType(1),
19295
19298
  "len": new basic_1.IntegerType(),
19296
19299
  "occ": new basic_1.IntegerType(),
@@ -19315,7 +19318,7 @@ BuiltIn.methods = [
19315
19318
  {
19316
19319
  name: "TO_LOWER",
19317
19320
  mandatory: {
19318
- "val": new basic_1.StringType(),
19321
+ "val": new basic_1.CLikeType(),
19319
19322
  },
19320
19323
  return: new basic_1.StringType(),
19321
19324
  version: version_1.Version.v702,
@@ -19323,7 +19326,7 @@ BuiltIn.methods = [
19323
19326
  {
19324
19327
  name: "TO_MIXED",
19325
19328
  mandatory: {
19326
- "val": new basic_1.StringType(),
19329
+ "val": new basic_1.CLikeType(),
19327
19330
  },
19328
19331
  optional: {
19329
19332
  "case": new basic_1.CharacterType(1),
@@ -19335,16 +19338,16 @@ BuiltIn.methods = [
19335
19338
  },
19336
19339
  {
19337
19340
  name: "TO_UPPER",
19338
- mandatory: { "val": new basic_1.StringType() },
19341
+ mandatory: { "val": new basic_1.CLikeType() },
19339
19342
  return: new basic_1.StringType(),
19340
19343
  version: version_1.Version.v702,
19341
19344
  },
19342
19345
  {
19343
19346
  name: "TRANSLATE",
19344
19347
  mandatory: {
19345
- "val": new basic_1.StringType(),
19346
- "from": new basic_1.StringType(),
19347
- "to": new basic_1.StringType(),
19348
+ "val": new basic_1.CLikeType(),
19349
+ "from": new basic_1.CLikeType(),
19350
+ "to": new basic_1.CLikeType(),
19348
19351
  },
19349
19352
  return: new basic_1.StringType(),
19350
19353
  version: version_1.Version.v702,
@@ -19387,7 +19390,7 @@ BuiltIn.methods = [
19387
19390
  {
19388
19391
  name: "XSDBOOL",
19389
19392
  mandatory: {
19390
- "val": new basic_1.StringType(),
19393
+ "val": new basic_1.CLikeType(),
19391
19394
  },
19392
19395
  return: new basic_1.CharacterType(1),
19393
19396
  version: version_1.Version.v740sp08,
@@ -19738,6 +19741,9 @@ class CurrentScope {
19738
19741
  getDDICReferences() {
19739
19742
  return this.reg.getDDICReferences();
19740
19743
  }
19744
+ getMSAGReferences() {
19745
+ return this.reg.getMSAGReferences();
19746
+ }
19741
19747
  getParentObj() {
19742
19748
  return this.parentObj;
19743
19749
  }
@@ -20604,7 +20610,7 @@ class TypeUtils {
20604
20610
  return false;
20605
20611
  }
20606
20612
  isAssignableStrict(source, target) {
20607
- var _a, _b, _c, _d;
20613
+ var _a, _b, _c, _d, _e;
20608
20614
  /*
20609
20615
  console.dir(source);
20610
20616
  console.dir(target);
@@ -20622,16 +20628,22 @@ class TypeUtils {
20622
20628
  }
20623
20629
  return false;
20624
20630
  }
20631
+ else if (target instanceof basic_1.StringType) {
20632
+ if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
20633
+ return true;
20634
+ }
20635
+ return false;
20636
+ }
20625
20637
  }
20626
20638
  else if (source instanceof basic_1.HexType) {
20627
20639
  if (target instanceof basic_1.HexType) {
20628
- if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
20640
+ if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
20629
20641
  return source.getLength() <= target.getLength();
20630
20642
  }
20631
20643
  return source.getLength() === target.getLength();
20632
20644
  }
20633
20645
  else if (target instanceof basic_1.IntegerType) {
20634
- if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
20646
+ if (((_e = source.getAbstractTypeData()) === null || _e === void 0 ? void 0 : _e.derivedFromConstant) === true) {
20635
20647
  return true;
20636
20648
  }
20637
20649
  return false;
@@ -23287,9 +23299,26 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
23287
23299
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
23288
23300
  class MessageSource {
23289
23301
  runSyntax(node, scope, filename) {
23302
+ var _a, _b, _c, _d;
23290
23303
  for (const f of node.findDirectExpressions(Expressions.Source)) {
23291
23304
  new source_1.Source().runSyntax(f, scope, filename);
23292
23305
  }
23306
+ if (node.getFirstToken().getStr().toUpperCase() === "ID") {
23307
+ const id = (_a = node.findExpressionAfterToken("ID")) === null || _a === void 0 ? void 0 : _a.concatTokens();
23308
+ const number = (_b = node.findDirectExpression(Expressions.MessageNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens();
23309
+ if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
23310
+ const messageClass = id.substring(1, id.length - 1).toUpperCase();
23311
+ scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
23312
+ }
23313
+ }
23314
+ else {
23315
+ const typeAndNumber = (_c = node.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _c === void 0 ? void 0 : _c.concatTokens();
23316
+ const messageNumber = typeAndNumber === null || typeAndNumber === void 0 ? void 0 : typeAndNumber.substring(1);
23317
+ const messageClass = (_d = node.findDirectExpression(Expressions.MessageClass)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
23318
+ if (messageNumber && messageClass) {
23319
+ scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, messageNumber);
23320
+ }
23321
+ }
23293
23322
  }
23294
23323
  }
23295
23324
  exports.MessageSource = MessageSource;
@@ -24483,6 +24512,7 @@ class Source {
24483
24512
  {
24484
24513
  const foundType = this.determineType(node, scope, filename, targetType);
24485
24514
  new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);
24515
+ this.addIfInferred(node, scope, filename, foundType);
24486
24516
  return foundType;
24487
24517
  }
24488
24518
  case "REF":
@@ -28680,7 +28710,7 @@ const raise_with_1 = __webpack_require__(/*! ../expressions/raise_with */ "./nod
28680
28710
  class Raise {
28681
28711
  runSyntax(node, scope, filename) {
28682
28712
  // todo
28683
- var _a;
28713
+ var _a, _b, _c;
28684
28714
  const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
28685
28715
  const classNam = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
28686
28716
  if (classNam) {
@@ -28729,6 +28759,12 @@ class Raise {
28729
28759
  for (const s of node.findDirectExpressions(Expressions.MessageSource)) {
28730
28760
  new message_source_1.MessageSource().runSyntax(s, scope, filename);
28731
28761
  }
28762
+ const id = (_b = node.findExpressionAfterToken("ID")) === null || _b === void 0 ? void 0 : _b.concatTokens();
28763
+ const number = (_c = node.findDirectExpression(Expressions.MessageNumber)) === null || _c === void 0 ? void 0 : _c.concatTokens();
28764
+ if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
28765
+ const messageClass = id.substring(1, id.length - 1).toUpperCase();
28766
+ scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
28767
+ }
28732
28768
  }
28733
28769
  }
28734
28770
  exports.Raise = Raise;
@@ -30998,6 +31034,7 @@ class SyntaxLogic {
30998
31034
  }
30999
31035
  this.issues = [];
31000
31036
  this.reg.getDDICReferences().clear(this.object);
31037
+ this.reg.getMSAGReferences().clear(this.object);
31001
31038
  if (this.object instanceof objects_1.Program && this.object.isInclude()) {
31002
31039
  // todo, show some kind of error?
31003
31040
  return { issues: [], spaghetti: this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)) };
@@ -35032,21 +35069,21 @@ exports.InterfaceDefinition = InterfaceDefinition;
35032
35069
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35033
35070
  exports.Message = void 0;
35034
35071
  class Message {
35035
- constructor(num, msg) {
35036
- this.num = num;
35037
- if (this.num === undefined) {
35038
- this.num = "";
35072
+ constructor(number, message) {
35073
+ this.number = number;
35074
+ if (this.number === undefined) {
35075
+ this.number = "";
35039
35076
  }
35040
- this.msg = msg;
35041
- if (this.msg === undefined) {
35042
- this.msg = "";
35077
+ this.message = message;
35078
+ if (this.message === undefined) {
35079
+ this.message = "";
35043
35080
  }
35044
35081
  }
35045
35082
  getNumber() {
35046
- return this.num;
35083
+ return this.number;
35047
35084
  }
35048
35085
  getMessage() {
35049
- return this.msg;
35086
+ return this.message;
35050
35087
  }
35051
35088
  getPlaceholderCount() {
35052
35089
  return (this.getMessage().match(/&/g) || []).length;
@@ -37282,7 +37319,7 @@ class DDIC {
37282
37319
  case "SSTRING": // 1 <= len <= 1333
37283
37320
  case "STRG": // 256 <= len
37284
37321
  case "STRING": // 256 <= len
37285
- return new Types.StringType({ qualifiedName: qualifiedName });
37322
+ return new Types.StringType({ qualifiedName: qualifiedName || "STRING" });
37286
37323
  case "RSTR": // 256 <= len
37287
37324
  case "RAWSTRING": // 256 <= len
37288
37325
  case "GEOM_EWKB":
@@ -37361,10 +37398,11 @@ class DDICReferences {
37361
37398
  }
37362
37399
  }
37363
37400
  }
37364
- const newName = obj.getName().toUpperCase();
37365
- const newType = obj.getType();
37366
- if ((_b = this.nameTypeIndex[newName]) === null || _b === void 0 ? void 0 : _b[newType]) {
37367
- this.nameTypeIndex[newName][newType] = [];
37401
+ // remove from name + type index
37402
+ const name = obj.getName().toUpperCase();
37403
+ const type = obj.getType();
37404
+ if ((_b = this.nameTypeIndex[name]) === null || _b === void 0 ? void 0 : _b[type]) {
37405
+ this.nameTypeIndex[name][type] = [];
37368
37406
  }
37369
37407
  }
37370
37408
  listByFilename(filename, line) {
@@ -38869,6 +38907,53 @@ exports.CodeActions = CodeActions;
38869
38907
 
38870
38908
  /***/ }),
38871
38909
 
38910
+ /***/ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js":
38911
+ /*!****************************************************************!*\
38912
+ !*** ./node_modules/@abaplint/core/build/src/lsp/code_lens.js ***!
38913
+ \****************************************************************/
38914
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
38915
+
38916
+ "use strict";
38917
+
38918
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
38919
+ exports.CodeLens = void 0;
38920
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
38921
+ const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
38922
+ const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
38923
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
38924
+ class CodeLens {
38925
+ constructor(reg) {
38926
+ this.reg = reg;
38927
+ }
38928
+ list(textDocument) {
38929
+ var _a;
38930
+ const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
38931
+ if (file === undefined) {
38932
+ return [];
38933
+ }
38934
+ const obj = this.reg.findObjectForFile(file);
38935
+ if (obj === undefined || !(obj instanceof _abap_object_1.ABAPObject)) {
38936
+ return [];
38937
+ }
38938
+ new syntax_1.SyntaxLogic(this.reg, obj).run();
38939
+ const ret = [];
38940
+ const list = this.reg.getMSAGReferences().listByFilename(file.getFilename());
38941
+ for (const l of list) {
38942
+ const msag = this.reg.getObject("MSAG", l.messageClass);
38943
+ if (msag === undefined) {
38944
+ continue;
38945
+ }
38946
+ const text = (_a = msag.getByNumber(l.number)) === null || _a === void 0 ? void 0 : _a.getMessage();
38947
+ ret.push(LServer.CodeLens.create(_lsp_utils_1.LSPUtils.tokenToRange(l.token), text));
38948
+ }
38949
+ return ret;
38950
+ }
38951
+ }
38952
+ exports.CodeLens = CodeLens;
38953
+ //# sourceMappingURL=code_lens.js.map
38954
+
38955
+ /***/ }),
38956
+
38872
38957
  /***/ "./node_modules/@abaplint/core/build/src/lsp/definition.js":
38873
38958
  /*!*****************************************************************!*\
38874
38959
  !*** ./node_modules/@abaplint/core/build/src/lsp/definition.js ***!
@@ -39566,6 +39651,7 @@ const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@ab
39566
39651
  const implementation_1 = __webpack_require__(/*! ./implementation */ "./node_modules/@abaplint/core/build/src/lsp/implementation.js");
39567
39652
  const semantic_1 = __webpack_require__(/*! ./semantic */ "./node_modules/@abaplint/core/build/src/lsp/semantic.js");
39568
39653
  const statement_flow_1 = __webpack_require__(/*! ../abap/flow/statement_flow */ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js");
39654
+ const code_lens_1 = __webpack_require__(/*! ./code_lens */ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js");
39569
39655
  // note Ranges are zero based in LSP,
39570
39656
  // https://github.com/microsoft/language-server-protocol/blob/main/versions/protocol-2-x.md#range
39571
39657
  // but 1 based in abaplint
@@ -39646,6 +39732,10 @@ class LanguageServer {
39646
39732
  semanticTokensRange(range) {
39647
39733
  return new semantic_1.SemanticHighlighting(this.reg).semanticTokensRange(range);
39648
39734
  }
39735
+ // https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeLens
39736
+ codeLens(textDocument) {
39737
+ return new code_lens_1.CodeLens(this.reg).list(textDocument);
39738
+ }
39649
39739
  ////////////////////////////////////////
39650
39740
  // ______ _
39651
39741
  // | ____| | |
@@ -40129,6 +40219,65 @@ exports.Symbols = Symbols;
40129
40219
 
40130
40220
  /***/ }),
40131
40221
 
40222
+ /***/ "./node_modules/@abaplint/core/build/src/msag_references.js":
40223
+ /*!******************************************************************!*\
40224
+ !*** ./node_modules/@abaplint/core/build/src/msag_references.js ***!
40225
+ \******************************************************************/
40226
+ /***/ ((__unused_webpack_module, exports) => {
40227
+
40228
+ "use strict";
40229
+
40230
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
40231
+ exports.MSAGReferences = void 0;
40232
+ class MSAGReferences {
40233
+ constructor() {
40234
+ this.nameNumberIndex = {};
40235
+ this.filenameIndex = {};
40236
+ }
40237
+ addUsing(filename, token, messageClass, number) {
40238
+ if (this.filenameIndex[filename] === undefined) {
40239
+ this.filenameIndex[filename] = [];
40240
+ }
40241
+ this.filenameIndex[filename].push({
40242
+ token: token,
40243
+ messageClass: messageClass,
40244
+ number: number,
40245
+ });
40246
+ if (this.nameNumberIndex[messageClass] === undefined) {
40247
+ this.nameNumberIndex[messageClass] = {};
40248
+ }
40249
+ if (this.nameNumberIndex[messageClass][number] === undefined) {
40250
+ this.nameNumberIndex[messageClass][number] = [];
40251
+ }
40252
+ this.nameNumberIndex[messageClass][number].push({
40253
+ filename: filename,
40254
+ token: token,
40255
+ });
40256
+ }
40257
+ clear(obj) {
40258
+ for (const file of obj.getFiles()) {
40259
+ const filename = file.getFilename();
40260
+ for (const fIndex of this.filenameIndex[filename] || []) {
40261
+ // this should be okay for performance, each message should be referenced less than 10 times typically
40262
+ this.nameNumberIndex[fIndex.messageClass][fIndex.number] =
40263
+ this.nameNumberIndex[fIndex.messageClass][fIndex.number].filter(i => i.filename !== filename);
40264
+ }
40265
+ delete this.filenameIndex[filename];
40266
+ }
40267
+ }
40268
+ listByFilename(filename) {
40269
+ return this.filenameIndex[filename] || [];
40270
+ }
40271
+ listByMessage(messageClass, number) {
40272
+ var _a;
40273
+ return ((_a = this.nameNumberIndex[messageClass]) === null || _a === void 0 ? void 0 : _a[number]) || [];
40274
+ }
40275
+ }
40276
+ exports.MSAGReferences = MSAGReferences;
40277
+ //# sourceMappingURL=msag_references.js.map
40278
+
40279
+ /***/ }),
40280
+
40132
40281
  /***/ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js":
40133
40282
  /*!***********************************************************************!*\
40134
40283
  !*** ./node_modules/@abaplint/core/build/src/objects/_abap_object.js ***!
@@ -43642,6 +43791,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
43642
43791
  return msg ? msg : [];
43643
43792
  }
43644
43793
  getByNumber(num) {
43794
+ // todo, optimize performance,
43645
43795
  for (const message of this.getMessages()) {
43646
43796
  if (message.getNumber() === num) {
43647
43797
  return message;
@@ -46603,6 +46753,7 @@ const find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global
46603
46753
  const excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ "./node_modules/@abaplint/core/build/src/utils/excludeHelper.js");
46604
46754
  const ddic_references_1 = __webpack_require__(/*! ./ddic_references */ "./node_modules/@abaplint/core/build/src/ddic_references.js");
46605
46755
  const rules_runner_1 = __webpack_require__(/*! ./rules_runner */ "./node_modules/@abaplint/core/build/src/rules_runner.js");
46756
+ const msag_references_1 = __webpack_require__(/*! ./msag_references */ "./node_modules/@abaplint/core/build/src/msag_references.js");
46606
46757
  // todo, this should really be an instance in case there are multiple Registry'ies
46607
46758
  class ParsingPerformance {
46608
46759
  static clear() {
@@ -46655,14 +46806,18 @@ class Registry {
46655
46806
  this.objectsByType = {};
46656
46807
  this.dependencies = {};
46657
46808
  this.conf = conf ? conf : config_1.Config.getDefault();
46658
- this.references = new ddic_references_1.DDICReferences();
46809
+ this.ddicReferences = new ddic_references_1.DDICReferences();
46810
+ this.msagReferences = new msag_references_1.MSAGReferences();
46659
46811
  }
46660
46812
  static abaplintVersion() {
46661
46813
  // magic, see build script "version.sh"
46662
- return "2.99.9";
46814
+ return "2.100.3";
46663
46815
  }
46664
46816
  getDDICReferences() {
46665
- return this.references;
46817
+ return this.ddicReferences;
46818
+ }
46819
+ getMSAGReferences() {
46820
+ return this.msagReferences;
46666
46821
  }
46667
46822
  *getObjects() {
46668
46823
  for (const name in this.objects) {
@@ -46750,7 +46905,8 @@ class Registry {
46750
46905
  const obj = this.find(file.getObjectName(), file.getObjectType());
46751
46906
  obj.removeFile(file);
46752
46907
  if (obj.getFiles().length === 0) {
46753
- this.references.clear(obj);
46908
+ this.ddicReferences.clear(obj);
46909
+ this.msagReferences.clear(obj);
46754
46910
  this.removeObject(obj);
46755
46911
  }
46756
46912
  return this;
@@ -53956,6 +54112,88 @@ exports.Downport = Downport;
53956
54112
 
53957
54113
  /***/ }),
53958
54114
 
54115
+ /***/ "./node_modules/@abaplint/core/build/src/rules/easy_to_find_messages.js":
54116
+ /*!******************************************************************************!*\
54117
+ !*** ./node_modules/@abaplint/core/build/src/rules/easy_to_find_messages.js ***!
54118
+ \******************************************************************************/
54119
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
54120
+
54121
+ "use strict";
54122
+
54123
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
54124
+ exports.EasyToFindMessages = exports.EasyToFindMessagesConf = void 0;
54125
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
54126
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
54127
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
54128
+ const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
54129
+ const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
54130
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
54131
+ class EasyToFindMessagesConf extends _basic_rule_config_1.BasicRuleConfig {
54132
+ }
54133
+ exports.EasyToFindMessagesConf = EasyToFindMessagesConf;
54134
+ class EasyToFindMessages {
54135
+ constructor() {
54136
+ this.conf = new EasyToFindMessagesConf();
54137
+ }
54138
+ getMetadata() {
54139
+ return {
54140
+ key: "easy_to_find_messages",
54141
+ title: "Easy to find messages",
54142
+ shortDescription: `Make messages easy to find`,
54143
+ extendedInformation: `All messages must be statically referenced exactly once
54144
+
54145
+ Only MESSAGE and RAISE statments are counted as static references
54146
+
54147
+ Also see rule "message_exists"
54148
+
54149
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
54150
+ tags: [_irule_1.RuleTag.Styleguide],
54151
+ };
54152
+ }
54153
+ getConfig() {
54154
+ return this.conf;
54155
+ }
54156
+ setConfig(conf) {
54157
+ this.conf = conf;
54158
+ }
54159
+ initialize(reg) {
54160
+ this.msagReferences = reg.getMSAGReferences();
54161
+ // the SyntaxLogic builds the references
54162
+ for (const obj of reg.getObjects()) {
54163
+ if (obj instanceof _abap_object_1.ABAPObject) {
54164
+ new syntax_1.SyntaxLogic(reg, obj).run();
54165
+ }
54166
+ }
54167
+ return this;
54168
+ }
54169
+ run(object) {
54170
+ const issues = [];
54171
+ if (object.getType() === "MSAG") {
54172
+ const msag = object;
54173
+ for (const message of msag.getMessages()) {
54174
+ const where = this.msagReferences.listByMessage(msag.getName().toUpperCase(), message.getNumber());
54175
+ if (where.length === 0) {
54176
+ const text = `Message ${message.getNumber()} not statically referenced`;
54177
+ const position = new position_1.Position(1, 1);
54178
+ const issue = issue_1.Issue.atPosition(object.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
54179
+ issues.push(issue);
54180
+ }
54181
+ else if (where.length >= 2) {
54182
+ const text = `Message ${message.getNumber()} referenced more than once`;
54183
+ const position = new position_1.Position(1, 1);
54184
+ const issue = issue_1.Issue.atPosition(object.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
54185
+ issues.push(issue);
54186
+ }
54187
+ }
54188
+ }
54189
+ return issues;
54190
+ }
54191
+ }
54192
+ exports.EasyToFindMessages = EasyToFindMessages;
54193
+ //# sourceMappingURL=easy_to_find_messages.js.map
54194
+
54195
+ /***/ }),
54196
+
53959
54197
  /***/ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js":
53960
54198
  /*!********************************************************************************!*\
53961
54199
  !*** ./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js ***!
@@ -53992,8 +54230,12 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
53992
54230
  key: "empty_line_in_statement",
53993
54231
  title: "Find empty lines in statements",
53994
54232
  shortDescription: `Checks that statements do not contain empty lines.`,
53995
- extendedInformation: `https://docs.abapopenchecks.org/checks/41/`,
53996
- tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
54233
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
54234
+
54235
+ https://docs.abapopenchecks.org/checks/41/`,
54236
+ tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
54237
+ badExample: `WRITE\n\nhello.`,
54238
+ goodExample: `WRITE hello.`,
53997
54239
  };
53998
54240
  }
53999
54241
  getMessage() {
@@ -56564,6 +56806,7 @@ __exportStar(__webpack_require__(/*! ./definitions_top */ "./node_modules/@abapl
56564
56806
  __exportStar(__webpack_require__(/*! ./description_empty */ "./node_modules/@abaplint/core/build/src/rules/description_empty.js"), exports);
56565
56807
  __exportStar(__webpack_require__(/*! ./double_space */ "./node_modules/@abaplint/core/build/src/rules/double_space.js"), exports);
56566
56808
  __exportStar(__webpack_require__(/*! ./downport */ "./node_modules/@abaplint/core/build/src/rules/downport.js"), exports);
56809
+ __exportStar(__webpack_require__(/*! ./easy_to_find_messages */ "./node_modules/@abaplint/core/build/src/rules/easy_to_find_messages.js"), exports);
56567
56810
  __exportStar(__webpack_require__(/*! ./empty_line_in_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js"), exports);
56568
56811
  __exportStar(__webpack_require__(/*! ./empty_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_statement.js"), exports);
56569
56812
  __exportStar(__webpack_require__(/*! ./empty_structure */ "./node_modules/@abaplint/core/build/src/rules/empty_structure.js"), exports);
@@ -59035,6 +59278,7 @@ class MSAGConsistency {
59035
59278
  key: "msag_consistency",
59036
59279
  title: "MSAG consistency check",
59037
59280
  shortDescription: `Checks the validity of messages in message classes`,
59281
+ extendedInformation: `Message numbers must be 3 digits, and message text must not be empty`,
59038
59282
  };
59039
59283
  }
59040
59284
  getDescription(reason) {
@@ -62646,6 +62890,10 @@ If the target is a sorted/hashed table, no issue is reported`,
62646
62890
  if (this.isTargetSortedOrHashed(s, spaghetti, file)) {
62647
62891
  continue;
62648
62892
  }
62893
+ else if (s.findFirstExpression(Expressions.SQLJoin) && s.findFirstExpression(Expressions.SQLForAllEntries)) {
62894
+ // see https://github.com/abaplint/abaplint/issues/2957
62895
+ continue;
62896
+ }
62649
62897
  issues.push(issue_1.Issue.atStatement(file, s, "Add ORDER BY", this.getMetadata().key, this.conf.severity));
62650
62898
  }
62651
62899
  }
@@ -74913,6 +75161,11 @@ class MethodImplementationTranspiler {
74913
75161
  const method = this.findMethod(methodName, classDef, traversal);
74914
75162
  let staticMethod = "";
74915
75163
  methodName = methodName.replace("~", "$").toLowerCase();
75164
+ if (methodName === "then") {
75165
+ // todo, this should be a checked in the validation step, but no abaplint rule for it?
75166
+ // it messes up promises when "this" is returned
75167
+ throw new Error(`Method name "then" not allowed`);
75168
+ }
74916
75169
  const superDef = traversal.findClassDefinition(classDef === null || classDef === void 0 ? void 0 : classDef.getSuperClass(), scope);
74917
75170
  for (const a of (superDef === null || superDef === void 0 ? void 0 : superDef.getAliases().getAll()) || []) {
74918
75171
  if (a.getName().toLowerCase() === methodName) {
@@ -75810,6 +76063,7 @@ class SelectTranspiler {
75810
76063
  var _a;
75811
76064
  let target = "undefined";
75812
76065
  if (targetOverride) {
76066
+ // SelectLoop structure uses override
75813
76067
  target = targetOverride;
75814
76068
  }
75815
76069
  else if (node.findFirstExpression(abaplint.Expressions.SQLIntoTable)) {
@@ -75871,8 +76125,12 @@ class SelectTranspiler {
75871
76125
  select += "UP TO 1 ROWS";
75872
76126
  }
75873
76127
  let runtimeOptions = "";
76128
+ const runtimeOptionsList = [];
75874
76129
  if (node.concatTokens().toUpperCase().includes(" APPENDING TABLE ")) {
75875
- runtimeOptions = `, {appending: true}`;
76130
+ runtimeOptionsList.push(`appending: true`);
76131
+ }
76132
+ if (runtimeOptionsList.length > 0) {
76133
+ runtimeOptions = `, {` + runtimeOptionsList.join(", ") + `}`;
75876
76134
  }
75877
76135
  let extra = "";
75878
76136
  const keys = this.findKeys(node, traversal);
@@ -77747,6 +78005,7 @@ exports.LoopTranspiler = LoopTranspiler;
77747
78005
 
77748
78006
  Object.defineProperty(exports, "__esModule", ({ value: true }));
77749
78007
  exports.SelectTranspiler = void 0;
78008
+ /* eslint-disable max-len */
77750
78009
  const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
77751
78010
  const select_1 = __webpack_require__(/*! ../statements/select */ "./node_modules/@abaplint/transpiler/build/src/statements/select.js");
77752
78011
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
@@ -77754,7 +78013,7 @@ const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./n
77754
78013
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
77755
78014
  class SelectTranspiler {
77756
78015
  transpile(node, traversal) {
77757
- var _a;
78016
+ var _a, _b;
77758
78017
  const ret = new chunk_1.Chunk();
77759
78018
  const selectStatement = node.findFirstStatement(abaplint.Statements.SelectLoop);
77760
78019
  if (selectStatement === undefined) {
@@ -77768,11 +78027,21 @@ class SelectTranspiler {
77768
78027
  const loopName = unique_identifier_1.UniqueIdentifier.get();
77769
78028
  ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC["${from}"].type);\n`);
77770
78029
  ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));
77771
- ret.appendString(`\nfor (const ${loopName} of ${targetName}.array()) {\n`);
77772
- if (concat.includes(" INTO CORRESPONDING FIELDS OF ")) {
78030
+ const packageSize = (_b = node.findFirstExpression(abaplint.Expressions.SelectLoop)) === null || _b === void 0 ? void 0 : _b.findExpressionAfterToken("SIZE");
78031
+ if (packageSize) {
78032
+ const getSize = new expressions_1.SQLSourceTranspiler().transpile(packageSize, traversal).getCode() + ".get()";
78033
+ ret.appendString(`if (${targetName}.array().length > ${getSize}) {
78034
+ throw new Error("PACKAGE SIZED loop larger than package size not supported");
78035
+ };
78036
+ abap.statements.append({source: ${targetName}, target: ${intoName}, lines: true});
78037
+ {\n`);
78038
+ }
78039
+ else if (concat.includes(" INTO CORRESPONDING FIELDS OF ")) {
78040
+ ret.appendString(`\nfor (const ${loopName} of ${targetName}.array()) {\n`);
77773
78041
  ret.appendString(`abap.statements.moveCorresponding(${loopName}, ${intoName});\n`);
77774
78042
  }
77775
78043
  else {
78044
+ ret.appendString(`\nfor (const ${loopName} of ${targetName}.array()) {\n`);
77776
78045
  ret.appendString(`${intoName}.set(${loopName});\n`);
77777
78046
  }
77778
78047
  const body = node.findDirectStructure(abaplint.Structures.Body);
@@ -78489,10 +78758,12 @@ class Traversal {
78489
78758
  ret += "this.me = new abap.types.ABAPObject();\n";
78490
78759
  ret += "this.me.set(this);\n";
78491
78760
  for (const a of ((_a = def.getAttributes()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
78761
+ const escaped = Traversal.escapeNamespace(a.getName().toLowerCase());
78492
78762
  if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
78763
+ ret += "this." + escaped + " = " + cName + "." + escaped + ";\n";
78493
78764
  continue;
78494
78765
  }
78495
- const name = "this." + Traversal.escapeNamespace(a.getName().toLowerCase());
78766
+ const name = "this." + escaped;
78496
78767
  ret += name + " = " + new transpile_types_1.TranspileTypes().toType(a.getType()) + ";\n";
78497
78768
  ret += this.setValues(a, name);
78498
78769
  }
@@ -78962,13 +79233,11 @@ async function run() {
78962
79233
  }
78963
79234
  }
78964
79235
  ret += `// -------------------END-------------------
78965
- console.log(abap.console.get());
78966
79236
  fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
78967
79237
  } catch (e) {
78968
79238
  if (meth) {
78969
79239
  meth.fail();
78970
79240
  }
78971
- console.log(abap.console.get());
78972
79241
  fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
78973
79242
  throw e;
78974
79243
  }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.6.44",
3
+ "version": "2.7.1",
4
4
  "description": "Transpiler - Command Line Interface",
5
+ "funding": "https://github.com/sponsors/larshp",
5
6
  "bin": {
6
7
  "abap_transpile": "./abap_transpile"
7
8
  },
@@ -25,12 +26,12 @@
25
26
  "author": "abaplint",
26
27
  "license": "MIT",
27
28
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.6.44",
29
+ "@abaplint/transpiler": "^2.7.1",
29
30
  "@types/glob": "^7.2.0",
30
31
  "glob": "=7.2.0",
31
32
  "@types/progress": "^2.0.5",
32
- "@types/node": "^20.1.2",
33
- "@abaplint/core": "^2.99.9",
33
+ "@types/node": "^20.1.5",
34
+ "@abaplint/core": "^2.100.3",
34
35
  "progress": "^2.0.3",
35
36
  "webpack": "^5.82.1",
36
37
  "webpack-cli": "^5.1.1",