@abaplint/core 2.99.10 → 2.100.0

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.
@@ -1300,6 +1300,7 @@ export declare class CurrentScope {
1300
1300
  findVariable(name: string | undefined): TypedIdentifier | undefined;
1301
1301
  getDDIC(): DDIC;
1302
1302
  getDDICReferences(): IDDICReferences;
1303
+ getMSAGReferences(): IMSAGReferences;
1303
1304
  getParentObj(): IObject;
1304
1305
  getName(): string;
1305
1306
  getType(): ScopeType;
@@ -3078,6 +3079,20 @@ declare class ImportNametab implements IStatement {
3078
3079
  getMatcher(): IStatementRunnable;
3079
3080
  }
3080
3081
 
3082
+ declare interface IMSAGReferences {
3083
+ clear(obj: IObject): void;
3084
+ addUsing(filename: string, token: Token, messageClass: string, number: string): void;
3085
+ listByFilename(filename: string): {
3086
+ token: Token;
3087
+ messageClass: string;
3088
+ number: string;
3089
+ }[];
3090
+ listByMessage(messageClass: string, number: string): {
3091
+ filename: string;
3092
+ token: Token;
3093
+ }[];
3094
+ }
3095
+
3081
3096
  declare class InboundService extends AbstractObject {
3082
3097
  getType(): string;
3083
3098
  getAllowedNaming(): {
@@ -3424,6 +3439,7 @@ export declare interface IRegistry {
3424
3439
  findIssuesObject(iobj: IObject): readonly Issue[];
3425
3440
  inErrorNamespace(name: string): boolean;
3426
3441
  getDDICReferences(): IDDICReferences;
3442
+ getMSAGReferences(): IMSAGReferences;
3427
3443
  getConfig(): IConfiguration;
3428
3444
  setConfig(conf: IConfiguration): IRegistry;
3429
3445
  /** Get all objects, including dependencies */
@@ -3842,9 +3858,9 @@ export declare class MemoryFile extends AbstractFile {
3842
3858
  }
3843
3859
 
3844
3860
  declare class Message {
3845
- private readonly num;
3846
- private readonly msg;
3847
- constructor(num: string, msg: string);
3861
+ private readonly number;
3862
+ private readonly message;
3863
+ constructor(number: string, message: string);
3848
3864
  getNumber(): string;
3849
3865
  getMessage(): string;
3850
3866
  getPlaceholderCount(): number;
@@ -4721,11 +4737,13 @@ export declare class Registry implements IRegistry {
4721
4737
  private readonly objects;
4722
4738
  private readonly objectsByType;
4723
4739
  private readonly dependencies;
4724
- private readonly references;
4740
+ private readonly ddicReferences;
4741
+ private readonly msagReferences;
4725
4742
  private conf;
4726
4743
  constructor(conf?: IConfiguration);
4727
4744
  static abaplintVersion(): string;
4728
4745
  getDDICReferences(): IDDICReferences;
4746
+ getMSAGReferences(): IMSAGReferences;
4729
4747
  getObjects(): Generator<IObject, void, undefined>;
4730
4748
  getObjectsByType(type: string): Generator<IObject, void, undefined>;
4731
4749
  getFiles(): Generator<IFile, void, undefined>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=_imsag_references.js.map
@@ -397,7 +397,7 @@ BuiltIn.methods = [
397
397
  {
398
398
  name: "BOOLC",
399
399
  mandatory: {
400
- "val": new basic_1.StringType(),
400
+ "val": new basic_1.CLikeType(),
401
401
  },
402
402
  return: new basic_1.StringType(),
403
403
  version: version_1.Version.v702,
@@ -405,7 +405,7 @@ BuiltIn.methods = [
405
405
  {
406
406
  name: "BOOLX",
407
407
  mandatory: {
408
- "bool": new basic_1.StringType(),
408
+ "bool": new basic_1.CLikeType(),
409
409
  },
410
410
  optional: {
411
411
  "bit": new basic_1.IntegerType(),
@@ -423,7 +423,7 @@ BuiltIn.methods = [
423
423
  {
424
424
  name: "CHAR_OFF",
425
425
  mandatory: {
426
- "val": new basic_1.StringType(),
426
+ "val": new basic_1.CLikeType(),
427
427
  "add": new basic_1.IntegerType(),
428
428
  },
429
429
  optional: {
@@ -435,23 +435,23 @@ BuiltIn.methods = [
435
435
  {
436
436
  name: "CHARLEN",
437
437
  mandatory: {
438
- "val": new basic_1.StringType(),
438
+ "val": new basic_1.CLikeType(),
439
439
  },
440
440
  return: new basic_1.IntegerType(),
441
441
  },
442
442
  {
443
443
  name: "CMAX",
444
444
  mandatory: {
445
- "val1": new basic_1.StringType(),
446
- "val2": new basic_1.StringType(),
445
+ "val1": new basic_1.CLikeType(),
446
+ "val2": new basic_1.CLikeType(),
447
447
  },
448
448
  optional: {
449
- "val3": new basic_1.StringType(),
450
- "val4": new basic_1.StringType(),
451
- "val5": new basic_1.StringType(),
452
- "val6": new basic_1.StringType(),
453
- "val7": new basic_1.StringType(),
454
- "val9": new basic_1.StringType(),
449
+ "val3": new basic_1.CLikeType(),
450
+ "val4": new basic_1.CLikeType(),
451
+ "val5": new basic_1.CLikeType(),
452
+ "val6": new basic_1.CLikeType(),
453
+ "val7": new basic_1.CLikeType(),
454
+ "val9": new basic_1.CLikeType(),
455
455
  },
456
456
  return: new basic_1.StringType(),
457
457
  version: version_1.Version.v702,
@@ -459,16 +459,16 @@ BuiltIn.methods = [
459
459
  {
460
460
  name: "CMIN",
461
461
  mandatory: {
462
- "val1": new basic_1.StringType(),
463
- "val2": new basic_1.StringType(),
462
+ "val1": new basic_1.CLikeType(),
463
+ "val2": new basic_1.CLikeType(),
464
464
  },
465
465
  optional: {
466
- "val3": new basic_1.StringType(),
467
- "val4": new basic_1.StringType(),
468
- "val5": new basic_1.StringType(),
469
- "val6": new basic_1.StringType(),
470
- "val7": new basic_1.StringType(),
471
- "val9": new basic_1.StringType(),
466
+ "val3": new basic_1.CLikeType(),
467
+ "val4": new basic_1.CLikeType(),
468
+ "val5": new basic_1.CLikeType(),
469
+ "val6": new basic_1.CLikeType(),
470
+ "val7": new basic_1.CLikeType(),
471
+ "val9": new basic_1.CLikeType(),
472
472
  },
473
473
  return: new basic_1.StringType(),
474
474
  version: version_1.Version.v702,
@@ -479,7 +479,7 @@ BuiltIn.methods = [
479
479
  "table": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
480
480
  },
481
481
  optional: {
482
- "sep": new basic_1.StringType(),
482
+ "sep": new basic_1.CLikeType(),
483
483
  },
484
484
  return: new basic_1.StringType(),
485
485
  version: version_1.Version.v702,
@@ -487,12 +487,12 @@ BuiltIn.methods = [
487
487
  {
488
488
  name: "CONDENSE",
489
489
  mandatory: {
490
- "val": new basic_1.StringType(),
490
+ "val": new basic_1.CLikeType(),
491
491
  },
492
492
  optional: {
493
- "del": new basic_1.StringType(),
494
- "from": new basic_1.StringType(),
495
- "to": new basic_1.StringType(),
493
+ "del": new basic_1.CLikeType(),
494
+ "from": new basic_1.CLikeType(),
495
+ "to": new basic_1.CLikeType(),
496
496
  },
497
497
  return: new basic_1.StringType(),
498
498
  version: version_1.Version.v702,
@@ -500,14 +500,14 @@ BuiltIn.methods = [
500
500
  {
501
501
  name: "CONTAINS",
502
502
  mandatory: {
503
- "val": new basic_1.StringType(),
503
+ "val": new basic_1.CLikeType(),
504
504
  },
505
505
  optional: {
506
- "sub": new basic_1.StringType(),
507
- "start": new basic_1.StringType(),
508
- "end": new basic_1.StringType(),
509
- "regex": new basic_1.StringType(),
510
- "pcre": new basic_1.StringType(),
506
+ "sub": new basic_1.CLikeType(),
507
+ "start": new basic_1.CLikeType(),
508
+ "end": new basic_1.CLikeType(),
509
+ "regex": new basic_1.CLikeType(),
510
+ "pcre": new basic_1.CLikeType(),
511
511
  "case": new basic_1.CharacterType(1),
512
512
  "off": new basic_1.IntegerType(),
513
513
  "len": new basic_1.IntegerType(),
@@ -520,12 +520,12 @@ BuiltIn.methods = [
520
520
  {
521
521
  name: "CONTAINS_ANY_NOT_OF",
522
522
  mandatory: {
523
- "val": new basic_1.StringType(),
523
+ "val": new basic_1.CLikeType(),
524
524
  },
525
525
  optional: {
526
- "sub": new basic_1.StringType(),
527
- "start": new basic_1.StringType(),
528
- "end": new basic_1.StringType(),
526
+ "sub": new basic_1.CLikeType(),
527
+ "start": new basic_1.CLikeType(),
528
+ "end": new basic_1.CLikeType(),
529
529
  "off": new basic_1.IntegerType(),
530
530
  "len": new basic_1.IntegerType(),
531
531
  "occ": new basic_1.IntegerType(),
@@ -536,12 +536,12 @@ BuiltIn.methods = [
536
536
  {
537
537
  name: "CONTAINS_ANY_OF",
538
538
  mandatory: {
539
- "val": new basic_1.StringType(),
539
+ "val": new basic_1.CLikeType(),
540
540
  },
541
541
  optional: {
542
- "sub": new basic_1.StringType(),
543
- "start": new basic_1.StringType(),
544
- "end": new basic_1.StringType(),
542
+ "sub": new basic_1.CLikeType(),
543
+ "start": new basic_1.CLikeType(),
544
+ "end": new basic_1.CLikeType(),
545
545
  "off": new basic_1.IntegerType(),
546
546
  "len": new basic_1.IntegerType(),
547
547
  "occ": new basic_1.IntegerType(),
@@ -567,12 +567,12 @@ BuiltIn.methods = [
567
567
  {
568
568
  name: "COUNT",
569
569
  mandatory: {
570
- "val": new basic_1.StringType(),
570
+ "val": new basic_1.CLikeType(),
571
571
  },
572
572
  optional: {
573
- "sub": new basic_1.StringType(),
574
- "regex": new basic_1.StringType(),
575
- "pcre": new basic_1.StringType(),
573
+ "sub": new basic_1.CLikeType(),
574
+ "regex": new basic_1.CLikeType(),
575
+ "pcre": new basic_1.CLikeType(),
576
576
  "case": new basic_1.CharacterType(1),
577
577
  "off": new basic_1.IntegerType(),
578
578
  "len": new basic_1.IntegerType(),
@@ -583,12 +583,12 @@ BuiltIn.methods = [
583
583
  {
584
584
  name: "COUNT_ANY_NOT_OF",
585
585
  mandatory: {
586
- "val": new basic_1.StringType(),
586
+ "val": new basic_1.CLikeType(),
587
587
  },
588
588
  optional: {
589
- "sub": new basic_1.StringType(),
590
- "regex": new basic_1.StringType(),
591
- "pcre": new basic_1.StringType(),
589
+ "sub": new basic_1.CLikeType(),
590
+ "regex": new basic_1.CLikeType(),
591
+ "pcre": new basic_1.CLikeType(),
592
592
  "case": new basic_1.CharacterType(1),
593
593
  "off": new basic_1.IntegerType(),
594
594
  "len": new basic_1.IntegerType(),
@@ -599,12 +599,12 @@ BuiltIn.methods = [
599
599
  {
600
600
  name: "COUNT_ANY_OF",
601
601
  mandatory: {
602
- "val": new basic_1.StringType(),
602
+ "val": new basic_1.CLikeType(),
603
603
  },
604
604
  optional: {
605
- "sub": new basic_1.StringType(),
606
- "regex": new basic_1.StringType(),
607
- "pcre": new basic_1.StringType(),
605
+ "sub": new basic_1.CLikeType(),
606
+ "regex": new basic_1.CLikeType(),
607
+ "pcre": new basic_1.CLikeType(),
608
608
  "case": new basic_1.CharacterType(1),
609
609
  "off": new basic_1.IntegerType(),
610
610
  "len": new basic_1.IntegerType(),
@@ -615,15 +615,15 @@ BuiltIn.methods = [
615
615
  {
616
616
  name: "DBMAXLEN",
617
617
  mandatory: {
618
- "val": new basic_1.StringType(),
618
+ "val": new basic_1.CLikeType(),
619
619
  },
620
620
  return: new basic_1.IntegerType(),
621
621
  },
622
622
  {
623
623
  name: "DISTANCE",
624
624
  mandatory: {
625
- "val1": new basic_1.StringType(),
626
- "val2": new basic_1.StringType(),
625
+ "val1": new basic_1.CLikeType(),
626
+ "val2": new basic_1.CLikeType(),
627
627
  },
628
628
  return: new basic_1.IntegerType(),
629
629
  version: version_1.Version.v702,
@@ -631,8 +631,8 @@ BuiltIn.methods = [
631
631
  {
632
632
  name: "ESCAPE",
633
633
  mandatory: {
634
- "val": new basic_1.StringType(),
635
- "format": new basic_1.StringType(),
634
+ "val": new basic_1.CLikeType(),
635
+ "format": new basic_1.CLikeType(),
636
636
  },
637
637
  return: new basic_1.StringType(),
638
638
  version: version_1.Version.v702,
@@ -647,12 +647,12 @@ BuiltIn.methods = [
647
647
  {
648
648
  name: "FIND",
649
649
  mandatory: {
650
- "val": new basic_1.StringType(),
650
+ "val": new basic_1.CLikeType(),
651
651
  },
652
652
  optional: {
653
- "sub": new basic_1.StringType(),
654
- "regex": new basic_1.StringType(),
655
- "pcre": new basic_1.StringType(),
653
+ "sub": new basic_1.CLikeType(),
654
+ "regex": new basic_1.CLikeType(),
655
+ "pcre": new basic_1.CLikeType(),
656
656
  "case": new basic_1.CharacterType(1),
657
657
  "off": new basic_1.IntegerType(),
658
658
  "len": new basic_1.IntegerType(),
@@ -664,10 +664,10 @@ BuiltIn.methods = [
664
664
  {
665
665
  name: "FIND_ANY_NOT_OF",
666
666
  mandatory: {
667
- "val": new basic_1.StringType(),
667
+ "val": new basic_1.CLikeType(),
668
668
  },
669
669
  optional: {
670
- "sub": new basic_1.StringType(),
670
+ "sub": new basic_1.CLikeType(),
671
671
  "off": new basic_1.IntegerType(),
672
672
  "len": new basic_1.IntegerType(),
673
673
  "occ": new basic_1.IntegerType(),
@@ -678,10 +678,10 @@ BuiltIn.methods = [
678
678
  {
679
679
  name: "FIND_ANY_OF",
680
680
  mandatory: {
681
- "val": new basic_1.StringType(),
681
+ "val": new basic_1.CLikeType(),
682
682
  },
683
683
  optional: {
684
- "sub": new basic_1.StringType(),
684
+ "sub": new basic_1.CLikeType(),
685
685
  "off": new basic_1.IntegerType(),
686
686
  "len": new basic_1.IntegerType(),
687
687
  "occ": new basic_1.IntegerType(),
@@ -692,12 +692,12 @@ BuiltIn.methods = [
692
692
  {
693
693
  name: "FIND_END",
694
694
  mandatory: {
695
- "val": new basic_1.StringType(),
695
+ "val": new basic_1.CLikeType(),
696
696
  },
697
697
  optional: {
698
- "sub": new basic_1.StringType(),
699
- "regex": new basic_1.StringType(),
700
- "pcre": new basic_1.StringType(),
698
+ "sub": new basic_1.CLikeType(),
699
+ "regex": new basic_1.CLikeType(),
700
+ "pcre": new basic_1.CLikeType(),
701
701
  "case": new basic_1.CharacterType(1),
702
702
  "off": new basic_1.IntegerType(),
703
703
  "len": new basic_1.IntegerType(),
@@ -722,7 +722,9 @@ BuiltIn.methods = [
722
722
  },
723
723
  {
724
724
  name: "FROM_MIXED",
725
- mandatory: { "val": new basic_1.StringType() },
725
+ mandatory: {
726
+ "val": new basic_1.CLikeType()
727
+ },
726
728
  optional: {
727
729
  "case": new basic_1.CharacterType(1),
728
730
  "sep": new basic_1.IntegerType(),
@@ -734,8 +736,8 @@ BuiltIn.methods = [
734
736
  {
735
737
  name: "INSERT",
736
738
  mandatory: {
737
- "val": new basic_1.StringType(),
738
- "sub": new basic_1.StringType(),
739
+ "val": new basic_1.CLikeType(),
740
+ "sub": new basic_1.CLikeType(),
739
741
  },
740
742
  optional: {
741
743
  "off": new basic_1.IntegerType(),
@@ -764,7 +766,7 @@ BuiltIn.methods = [
764
766
  {
765
767
  name: "LINE_INDEX",
766
768
  mandatory: {
767
- "val": new basic_1.StringType(),
769
+ "val": new basic_1.CLikeType(),
768
770
  },
769
771
  return: new basic_1.IntegerType(),
770
772
  version: version_1.Version.v740sp02,
@@ -793,11 +795,11 @@ BuiltIn.methods = [
793
795
  {
794
796
  name: "MATCH",
795
797
  mandatory: {
796
- "val": new basic_1.StringType(),
798
+ "val": new basic_1.CLikeType(),
797
799
  }, optional: {
798
800
  "case": new basic_1.CharacterType(1),
799
- "regex": new basic_1.StringType(),
800
- "pcre": new basic_1.StringType(),
801
+ "regex": new basic_1.CLikeType(),
802
+ "pcre": new basic_1.CLikeType(),
801
803
  "occ": new basic_1.IntegerType(),
802
804
  },
803
805
  return: new basic_1.StringType(),
@@ -806,12 +808,12 @@ BuiltIn.methods = [
806
808
  {
807
809
  name: "MATCHES",
808
810
  mandatory: {
809
- "val": new basic_1.StringType(),
811
+ "val": new basic_1.CLikeType(),
810
812
  },
811
813
  optional: {
812
814
  "case": new basic_1.CharacterType(1),
813
- "regex": new basic_1.StringType(),
814
- "pcre": new basic_1.StringType(),
815
+ "regex": new basic_1.CLikeType(),
816
+ "pcre": new basic_1.CLikeType(),
815
817
  "off": new basic_1.IntegerType(),
816
818
  "len": new basic_1.IntegerType(),
817
819
  },
@@ -822,17 +824,17 @@ BuiltIn.methods = [
822
824
  {
823
825
  name: "NMAX",
824
826
  mandatory: {
825
- "val1": new basic_1.StringType(),
826
- "val2": new basic_1.StringType(),
827
+ "val1": new basic_1.CLikeType(),
828
+ "val2": new basic_1.CLikeType(),
827
829
  },
828
830
  optional: {
829
- "val3": new basic_1.StringType(),
830
- "val4": new basic_1.StringType(),
831
- "val5": new basic_1.StringType(),
832
- "val6": new basic_1.StringType(),
833
- "val7": new basic_1.StringType(),
834
- "val8": new basic_1.StringType(),
835
- "val9": new basic_1.StringType(),
831
+ "val3": new basic_1.CLikeType(),
832
+ "val4": new basic_1.CLikeType(),
833
+ "val5": new basic_1.CLikeType(),
834
+ "val6": new basic_1.CLikeType(),
835
+ "val7": new basic_1.CLikeType(),
836
+ "val8": new basic_1.CLikeType(),
837
+ "val9": new basic_1.CLikeType(),
836
838
  },
837
839
  return: new basic_1.IntegerType(),
838
840
  version: version_1.Version.v702,
@@ -840,17 +842,17 @@ BuiltIn.methods = [
840
842
  {
841
843
  name: "NMIN",
842
844
  mandatory: {
843
- "val1": new basic_1.StringType(),
844
- "val2": new basic_1.StringType(),
845
+ "val1": new basic_1.CLikeType(),
846
+ "val2": new basic_1.CLikeType(),
845
847
  },
846
848
  optional: {
847
- "val3": new basic_1.StringType(),
848
- "val4": new basic_1.StringType(),
849
- "val5": new basic_1.StringType(),
850
- "val6": new basic_1.StringType(),
851
- "val7": new basic_1.StringType(),
852
- "val8": new basic_1.StringType(),
853
- "val9": new basic_1.StringType(),
849
+ "val3": new basic_1.CLikeType(),
850
+ "val4": new basic_1.CLikeType(),
851
+ "val5": new basic_1.CLikeType(),
852
+ "val6": new basic_1.CLikeType(),
853
+ "val7": new basic_1.CLikeType(),
854
+ "val8": new basic_1.CLikeType(),
855
+ "val9": new basic_1.CLikeType(),
854
856
  },
855
857
  return: new basic_1.IntegerType(),
856
858
  version: version_1.Version.v702,
@@ -858,14 +860,14 @@ BuiltIn.methods = [
858
860
  {
859
861
  name: "NUMOFCHAR",
860
862
  mandatory: {
861
- "val": new basic_1.StringType(),
863
+ "val": new basic_1.CLikeType(),
862
864
  },
863
865
  return: new basic_1.IntegerType(),
864
866
  },
865
867
  {
866
868
  name: "REPEAT",
867
869
  mandatory: {
868
- "val": new basic_1.StringType(),
870
+ "val": new basic_1.CLikeType(),
869
871
  "occ": new basic_1.IntegerType(),
870
872
  },
871
873
  return: new basic_1.StringType(),
@@ -874,13 +876,13 @@ BuiltIn.methods = [
874
876
  {
875
877
  name: "REPLACE",
876
878
  mandatory: {
877
- "val": new basic_1.StringType(),
878
- "with": new basic_1.StringType(),
879
+ "val": new basic_1.CLikeType(),
880
+ "with": new basic_1.CLikeType(),
879
881
  },
880
882
  optional: {
881
- "sub": new basic_1.StringType(),
882
- "regex": new basic_1.StringType(),
883
- "pcre": new basic_1.StringType(),
883
+ "sub": new basic_1.CLikeType(),
884
+ "regex": new basic_1.CLikeType(),
885
+ "pcre": new basic_1.CLikeType(),
884
886
  "case": new basic_1.CharacterType(1),
885
887
  "off": new basic_1.IntegerType(),
886
888
  "len": new basic_1.IntegerType(),
@@ -905,7 +907,7 @@ BuiltIn.methods = [
905
907
  {
906
908
  name: "REVERSE",
907
909
  mandatory: {
908
- "val": new basic_1.StringType(),
910
+ "val": new basic_1.CLikeType(),
909
911
  },
910
912
  return: new basic_1.StringType(),
911
913
  version: version_1.Version.v702,
@@ -926,12 +928,12 @@ BuiltIn.methods = [
926
928
  {
927
929
  name: "SEGMENT",
928
930
  mandatory: {
929
- "val": new basic_1.StringType(),
931
+ "val": new basic_1.CLikeType(),
930
932
  "index": new basic_1.IntegerType(),
931
933
  },
932
934
  optional: {
933
- "sep": new basic_1.StringType(),
934
- "space": new basic_1.StringType(),
935
+ "sep": new basic_1.CLikeType(),
936
+ "space": new basic_1.CLikeType(),
935
937
  },
936
938
  return: new basic_1.StringType(),
937
939
  version: version_1.Version.v702,
@@ -939,10 +941,10 @@ BuiltIn.methods = [
939
941
  {
940
942
  name: "SHIFT_LEFT",
941
943
  mandatory: {
942
- "val": new basic_1.StringType(),
944
+ "val": new basic_1.CLikeType(),
943
945
  },
944
946
  optional: {
945
- "sub": new basic_1.StringType(),
947
+ "sub": new basic_1.CLikeType(),
946
948
  "places": new basic_1.IntegerType(),
947
949
  "circular": new basic_1.IntegerType(),
948
950
  },
@@ -952,10 +954,10 @@ BuiltIn.methods = [
952
954
  {
953
955
  name: "SHIFT_RIGHT",
954
956
  mandatory: {
955
- "val": new basic_1.StringType(),
957
+ "val": new basic_1.CLikeType(),
956
958
  },
957
959
  optional: {
958
- "sub": new basic_1.StringType(),
960
+ "sub": new basic_1.CLikeType(),
959
961
  "places": new basic_1.IntegerType(),
960
962
  "circular": new basic_1.IntegerType(),
961
963
  },
@@ -1015,9 +1017,9 @@ BuiltIn.methods = [
1015
1017
  "val": new basic_1.CLikeType(),
1016
1018
  },
1017
1019
  optional: {
1018
- "sub": new basic_1.StringType(),
1019
- "regex": new basic_1.StringType(),
1020
- "pcre": new basic_1.StringType(),
1020
+ "sub": new basic_1.CLikeType(),
1021
+ "regex": new basic_1.CLikeType(),
1022
+ "pcre": new basic_1.CLikeType(),
1021
1023
  "case": new basic_1.CharacterType(1),
1022
1024
  "len": new basic_1.IntegerType(),
1023
1025
  "occ": new basic_1.IntegerType(),
@@ -1031,9 +1033,9 @@ BuiltIn.methods = [
1031
1033
  "val": new basic_1.CLikeType(),
1032
1034
  },
1033
1035
  optional: {
1034
- "sub": new basic_1.StringType(),
1035
- "regex": new basic_1.StringType(),
1036
- "pcre": new basic_1.StringType(),
1036
+ "sub": new basic_1.CLikeType(),
1037
+ "regex": new basic_1.CLikeType(),
1038
+ "pcre": new basic_1.CLikeType(),
1037
1039
  "case": new basic_1.CharacterType(1),
1038
1040
  "len": new basic_1.IntegerType(),
1039
1041
  "occ": new basic_1.IntegerType(),
@@ -1047,9 +1049,9 @@ BuiltIn.methods = [
1047
1049
  "val": new basic_1.CLikeType(),
1048
1050
  },
1049
1051
  optional: {
1050
- "sub": new basic_1.StringType(),
1051
- "regex": new basic_1.StringType(),
1052
- "pcre": new basic_1.StringType(),
1052
+ "sub": new basic_1.CLikeType(),
1053
+ "regex": new basic_1.CLikeType(),
1054
+ "pcre": new basic_1.CLikeType(),
1053
1055
  "case": new basic_1.CharacterType(1),
1054
1056
  "len": new basic_1.IntegerType(),
1055
1057
  "occ": new basic_1.IntegerType(),
@@ -1063,9 +1065,9 @@ BuiltIn.methods = [
1063
1065
  "val": new basic_1.CLikeType(),
1064
1066
  },
1065
1067
  optional: {
1066
- "sub": new basic_1.StringType(),
1067
- "regex": new basic_1.StringType(),
1068
- "pcre": new basic_1.StringType(),
1068
+ "sub": new basic_1.CLikeType(),
1069
+ "regex": new basic_1.CLikeType(),
1070
+ "pcre": new basic_1.CLikeType(),
1069
1071
  "case": new basic_1.CharacterType(1),
1070
1072
  "len": new basic_1.IntegerType(),
1071
1073
  "occ": new basic_1.IntegerType(),
@@ -1090,7 +1092,7 @@ BuiltIn.methods = [
1090
1092
  {
1091
1093
  name: "TO_LOWER",
1092
1094
  mandatory: {
1093
- "val": new basic_1.StringType(),
1095
+ "val": new basic_1.CLikeType(),
1094
1096
  },
1095
1097
  return: new basic_1.StringType(),
1096
1098
  version: version_1.Version.v702,
@@ -1098,7 +1100,7 @@ BuiltIn.methods = [
1098
1100
  {
1099
1101
  name: "TO_MIXED",
1100
1102
  mandatory: {
1101
- "val": new basic_1.StringType(),
1103
+ "val": new basic_1.CLikeType(),
1102
1104
  },
1103
1105
  optional: {
1104
1106
  "case": new basic_1.CharacterType(1),
@@ -1110,16 +1112,16 @@ BuiltIn.methods = [
1110
1112
  },
1111
1113
  {
1112
1114
  name: "TO_UPPER",
1113
- mandatory: { "val": new basic_1.StringType() },
1115
+ mandatory: { "val": new basic_1.CLikeType() },
1114
1116
  return: new basic_1.StringType(),
1115
1117
  version: version_1.Version.v702,
1116
1118
  },
1117
1119
  {
1118
1120
  name: "TRANSLATE",
1119
1121
  mandatory: {
1120
- "val": new basic_1.StringType(),
1121
- "from": new basic_1.StringType(),
1122
- "to": new basic_1.StringType(),
1122
+ "val": new basic_1.CLikeType(),
1123
+ "from": new basic_1.CLikeType(),
1124
+ "to": new basic_1.CLikeType(),
1123
1125
  },
1124
1126
  return: new basic_1.StringType(),
1125
1127
  version: version_1.Version.v702,
@@ -1162,7 +1164,7 @@ BuiltIn.methods = [
1162
1164
  {
1163
1165
  name: "XSDBOOL",
1164
1166
  mandatory: {
1165
- "val": new basic_1.StringType(),
1167
+ "val": new basic_1.CLikeType(),
1166
1168
  },
1167
1169
  return: new basic_1.CharacterType(1),
1168
1170
  version: version_1.Version.v740sp08,
@@ -324,6 +324,9 @@ class CurrentScope {
324
324
  getDDICReferences() {
325
325
  return this.reg.getDDICReferences();
326
326
  }
327
+ getMSAGReferences() {
328
+ return this.reg.getMSAGReferences();
329
+ }
327
330
  getParentObj() {
328
331
  return this.parentObj;
329
332
  }
@@ -208,7 +208,7 @@ class TypeUtils {
208
208
  return false;
209
209
  }
210
210
  isAssignableStrict(source, target) {
211
- var _a, _b, _c, _d;
211
+ var _a, _b, _c, _d, _e;
212
212
  /*
213
213
  console.dir(source);
214
214
  console.dir(target);
@@ -226,16 +226,22 @@ class TypeUtils {
226
226
  }
227
227
  return false;
228
228
  }
229
+ else if (target instanceof basic_1.StringType) {
230
+ if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
231
+ return true;
232
+ }
233
+ return false;
234
+ }
229
235
  }
230
236
  else if (source instanceof basic_1.HexType) {
231
237
  if (target instanceof basic_1.HexType) {
232
- if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
238
+ if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
233
239
  return source.getLength() <= target.getLength();
234
240
  }
235
241
  return source.getLength() === target.getLength();
236
242
  }
237
243
  else if (target instanceof basic_1.IntegerType) {
238
- if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
244
+ if (((_e = source.getAbstractTypeData()) === null || _e === void 0 ? void 0 : _e.derivedFromConstant) === true) {
239
245
  return true;
240
246
  }
241
247
  return false;
@@ -5,9 +5,26 @@ const Expressions = require("../../2_statements/expressions");
5
5
  const source_1 = require("./source");
6
6
  class MessageSource {
7
7
  runSyntax(node, scope, filename) {
8
+ var _a, _b, _c, _d;
8
9
  for (const f of node.findDirectExpressions(Expressions.Source)) {
9
10
  new source_1.Source().runSyntax(f, scope, filename);
10
11
  }
12
+ if (node.getFirstToken().getStr().toUpperCase() === "ID") {
13
+ const id = (_a = node.findExpressionAfterToken("ID")) === null || _a === void 0 ? void 0 : _a.concatTokens();
14
+ const number = (_b = node.findDirectExpression(Expressions.MessageNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens();
15
+ if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
16
+ const messageClass = id.substring(1, id.length - 1).toUpperCase();
17
+ scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
18
+ }
19
+ }
20
+ else {
21
+ const typeAndNumber = (_c = node.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _c === void 0 ? void 0 : _c.concatTokens();
22
+ const messageNumber = typeAndNumber === null || typeAndNumber === void 0 ? void 0 : typeAndNumber.substring(1);
23
+ const messageClass = (_d = node.findDirectExpression(Expressions.MessageClass)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
24
+ if (messageNumber && messageClass) {
25
+ scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, messageNumber);
26
+ }
27
+ }
11
28
  }
12
29
  }
13
30
  exports.MessageSource = MessageSource;
@@ -285,6 +285,7 @@ class SyntaxLogic {
285
285
  }
286
286
  this.issues = [];
287
287
  this.reg.getDDICReferences().clear(this.object);
288
+ this.reg.getMSAGReferences().clear(this.object);
288
289
  if (this.object instanceof objects_1.Program && this.object.isInclude()) {
289
290
  // todo, show some kind of error?
290
291
  return { issues: [], spaghetti: this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)) };
@@ -2,21 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Message = void 0;
4
4
  class Message {
5
- constructor(num, msg) {
6
- this.num = num;
7
- if (this.num === undefined) {
8
- this.num = "";
5
+ constructor(number, message) {
6
+ this.number = number;
7
+ if (this.number === undefined) {
8
+ this.number = "";
9
9
  }
10
- this.msg = msg;
11
- if (this.msg === undefined) {
12
- this.msg = "";
10
+ this.message = message;
11
+ if (this.message === undefined) {
12
+ this.message = "";
13
13
  }
14
14
  }
15
15
  getNumber() {
16
- return this.num;
16
+ return this.number;
17
17
  }
18
18
  getMessage() {
19
- return this.msg;
19
+ return this.message;
20
20
  }
21
21
  getPlaceholderCount() {
22
22
  return (this.getMessage().match(/&/g) || []).length;
@@ -48,10 +48,11 @@ class DDICReferences {
48
48
  }
49
49
  }
50
50
  }
51
- const newName = obj.getName().toUpperCase();
52
- const newType = obj.getType();
53
- if ((_b = this.nameTypeIndex[newName]) === null || _b === void 0 ? void 0 : _b[newType]) {
54
- this.nameTypeIndex[newName][newType] = [];
51
+ // remove from name + type index
52
+ const name = obj.getName().toUpperCase();
53
+ const type = obj.getType();
54
+ if ((_b = this.nameTypeIndex[name]) === null || _b === void 0 ? void 0 : _b[type]) {
55
+ this.nameTypeIndex[name][type] = [];
55
56
  }
56
57
  }
57
58
  listByFilename(filename, line) {
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MSAGReferences = void 0;
4
+ class MSAGReferences {
5
+ constructor() {
6
+ this.nameNumberIndex = {};
7
+ this.filenameIndex = {};
8
+ }
9
+ addUsing(filename, token, messageClass, number) {
10
+ if (this.filenameIndex[filename] === undefined) {
11
+ this.filenameIndex[filename] = [];
12
+ }
13
+ this.filenameIndex[filename].push({
14
+ token: token,
15
+ messageClass: messageClass,
16
+ number: number,
17
+ });
18
+ if (this.nameNumberIndex[messageClass] === undefined) {
19
+ this.nameNumberIndex[messageClass] = {};
20
+ }
21
+ if (this.nameNumberIndex[messageClass][number] === undefined) {
22
+ this.nameNumberIndex[messageClass][number] = [];
23
+ }
24
+ this.nameNumberIndex[messageClass][number].push({
25
+ filename: filename,
26
+ token: token,
27
+ });
28
+ }
29
+ clear(obj) {
30
+ for (const file of obj.getFiles()) {
31
+ const filename = file.getFilename();
32
+ for (const fIndex of this.filenameIndex[filename] || []) {
33
+ // this should be okay for performance, each message should be referenced less than 10 times typically
34
+ this.nameNumberIndex[fIndex.messageClass][fIndex.number] =
35
+ this.nameNumberIndex[fIndex.messageClass][fIndex.number].filter(i => i.filename !== filename);
36
+ }
37
+ delete this.filenameIndex[filename];
38
+ }
39
+ }
40
+ listByFilename(filename) {
41
+ return this.filenameIndex[filename] || [];
42
+ }
43
+ listByMessage(messageClass, number) {
44
+ var _a;
45
+ return ((_a = this.nameNumberIndex[messageClass]) === null || _a === void 0 ? void 0 : _a[number]) || [];
46
+ }
47
+ }
48
+ exports.MSAGReferences = MSAGReferences;
49
+ //# sourceMappingURL=msag_references.js.map
@@ -32,6 +32,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
32
32
  return msg ? msg : [];
33
33
  }
34
34
  getByNumber(num) {
35
+ // todo, optimize performance,
35
36
  for (const message of this.getMessages()) {
36
37
  if (message.getNumber() === num) {
37
38
  return message;
@@ -7,6 +7,7 @@ const find_global_definitions_1 = require("./abap/5_syntax/global_definitions/fi
7
7
  const excludeHelper_1 = require("./utils/excludeHelper");
8
8
  const ddic_references_1 = require("./ddic_references");
9
9
  const rules_runner_1 = require("./rules_runner");
10
+ const msag_references_1 = require("./msag_references");
10
11
  // todo, this should really be an instance in case there are multiple Registry'ies
11
12
  class ParsingPerformance {
12
13
  static clear() {
@@ -59,14 +60,18 @@ class Registry {
59
60
  this.objectsByType = {};
60
61
  this.dependencies = {};
61
62
  this.conf = conf ? conf : config_1.Config.getDefault();
62
- this.references = new ddic_references_1.DDICReferences();
63
+ this.ddicReferences = new ddic_references_1.DDICReferences();
64
+ this.msagReferences = new msag_references_1.MSAGReferences();
63
65
  }
64
66
  static abaplintVersion() {
65
67
  // magic, see build script "version.sh"
66
- return "2.99.10";
68
+ return "2.100.0";
67
69
  }
68
70
  getDDICReferences() {
69
- return this.references;
71
+ return this.ddicReferences;
72
+ }
73
+ getMSAGReferences() {
74
+ return this.msagReferences;
70
75
  }
71
76
  *getObjects() {
72
77
  for (const name in this.objects) {
@@ -154,7 +159,8 @@ class Registry {
154
159
  const obj = this.find(file.getObjectName(), file.getObjectType());
155
160
  obj.removeFile(file);
156
161
  if (obj.getFiles().length === 0) {
157
- this.references.clear(obj);
162
+ this.ddicReferences.clear(obj);
163
+ this.msagReferences.clear(obj);
158
164
  this.removeObject(obj);
159
165
  }
160
166
  return this;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EasyToFindMessages = exports.EasyToFindMessagesConf = void 0;
4
+ const issue_1 = require("../issue");
5
+ const _irule_1 = require("./_irule");
6
+ const _basic_rule_config_1 = require("./_basic_rule_config");
7
+ const position_1 = require("../position");
8
+ const syntax_1 = require("../abap/5_syntax/syntax");
9
+ const _abap_object_1 = require("../objects/_abap_object");
10
+ class EasyToFindMessagesConf extends _basic_rule_config_1.BasicRuleConfig {
11
+ }
12
+ exports.EasyToFindMessagesConf = EasyToFindMessagesConf;
13
+ class EasyToFindMessages {
14
+ constructor() {
15
+ this.conf = new EasyToFindMessagesConf();
16
+ }
17
+ getMetadata() {
18
+ return {
19
+ key: "easy_to_find_messages",
20
+ title: "Easy to find messages",
21
+ shortDescription: `Make messages easy to find`,
22
+ extendedInformation: `All messages must be statically referenced exactly once
23
+
24
+ Only MESSAGE and RAISE statments are counted as static references
25
+
26
+ Also see rule "message_exists"
27
+
28
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
29
+ tags: [_irule_1.RuleTag.Styleguide],
30
+ };
31
+ }
32
+ getConfig() {
33
+ return this.conf;
34
+ }
35
+ setConfig(conf) {
36
+ this.conf = conf;
37
+ }
38
+ initialize(reg) {
39
+ this.msagReferences = reg.getMSAGReferences();
40
+ // the SyntaxLogic builds the references
41
+ for (const obj of reg.getObjects()) {
42
+ if (obj instanceof _abap_object_1.ABAPObject) {
43
+ new syntax_1.SyntaxLogic(reg, obj).run();
44
+ }
45
+ }
46
+ return this;
47
+ }
48
+ run(object) {
49
+ const issues = [];
50
+ if (object.getType() === "MSAG") {
51
+ const msag = object;
52
+ for (const message of msag.getMessages()) {
53
+ const where = this.msagReferences.listByMessage(msag.getName().toUpperCase(), message.getNumber());
54
+ if (where.length === 0) {
55
+ const text = `Message ${message.getNumber()} not statically referenced`;
56
+ const position = new position_1.Position(1, 1);
57
+ const issue = issue_1.Issue.atPosition(object.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
58
+ issues.push(issue);
59
+ }
60
+ else if (where.length >= 2) {
61
+ const text = `Message ${message.getNumber()} referenced more than once`;
62
+ const position = new position_1.Position(1, 1);
63
+ const issue = issue_1.Issue.atPosition(object.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
64
+ issues.push(issue);
65
+ }
66
+ }
67
+ }
68
+ return issues;
69
+ }
70
+ }
71
+ exports.EasyToFindMessages = EasyToFindMessages;
72
+ //# sourceMappingURL=easy_to_find_messages.js.map
@@ -53,6 +53,7 @@ __exportStar(require("./definitions_top"), exports);
53
53
  __exportStar(require("./description_empty"), exports);
54
54
  __exportStar(require("./double_space"), exports);
55
55
  __exportStar(require("./downport"), exports);
56
+ __exportStar(require("./easy_to_find_messages"), exports);
56
57
  __exportStar(require("./empty_line_in_statement"), exports);
57
58
  __exportStar(require("./empty_statement"), exports);
58
59
  __exportStar(require("./empty_structure"), exports);
@@ -17,6 +17,7 @@ class MSAGConsistency {
17
17
  key: "msag_consistency",
18
18
  title: "MSAG consistency check",
19
19
  shortDescription: `Checks the validity of messages in message classes`,
20
+ extendedInformation: `Message numbers must be 3 digits, and message text must not be empty`,
20
21
  };
21
22
  }
22
23
  getDescription(reason) {
@@ -70,6 +70,10 @@ If the target is a sorted/hashed table, no issue is reported`,
70
70
  if (this.isTargetSortedOrHashed(s, spaghetti, file)) {
71
71
  continue;
72
72
  }
73
+ else if (s.findFirstExpression(Expressions.SQLJoin) && s.findFirstExpression(Expressions.SQLForAllEntries)) {
74
+ // see https://github.com/abaplint/abaplint/issues/2957
75
+ continue;
76
+ }
73
77
  issues.push(issue_1.Issue.atStatement(file, s, "Add ORDER BY", this.getMetadata().key, this.conf.severity));
74
78
  }
75
79
  }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.99.10",
3
+ "version": "2.100.0",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
7
+ "funding": "https://github.com/sponsors/larshp",
7
8
  "scripts": {
8
9
  "lint": "eslint src/**/*.ts test/**/*.ts --format unix",
9
10
  "lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
@@ -47,10 +48,10 @@
47
48
  },
48
49
  "homepage": "https://abaplint.org",
49
50
  "devDependencies": {
50
- "@microsoft/api-extractor": "^7.34.8",
51
+ "@microsoft/api-extractor": "^7.34.9",
51
52
  "@types/chai": "^4.3.5",
52
53
  "@types/mocha": "^10.0.1",
53
- "@types/node": "^20.1.2",
54
+ "@types/node": "^20.1.3",
54
55
  "chai": "^4.3.7",
55
56
  "eslint": "^8.40.0",
56
57
  "mocha": "^10.2.0",