@abaplint/core 2.85.41 → 2.85.44

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.
@@ -805,6 +805,7 @@ declare class ClassDefinition_3 extends Identifier implements IClassDefinition {
805
805
  private readonly implementing;
806
806
  private readonly testing;
807
807
  private readonly abstract;
808
+ private readonly sharedMemory;
808
809
  private aliases;
809
810
  constructor(node: StructureNode, filename: string, scope: CurrentScope);
810
811
  getFriends(): string[];
@@ -819,6 +820,7 @@ declare class ClassDefinition_3 extends Identifier implements IClassDefinition {
819
820
  getAliases(): IAliases;
820
821
  isForTesting(): boolean;
821
822
  isAbstract(): boolean;
823
+ isSharedMemory(): boolean;
822
824
  private findSuper;
823
825
  private findFriends;
824
826
  private addReference;
@@ -2553,6 +2555,7 @@ export declare interface IClassDefinition extends IInterfaceDefinition {
2553
2555
  isFinal(): boolean;
2554
2556
  isForTesting(): boolean;
2555
2557
  isAbstract(): boolean;
2558
+ isSharedMemory(): boolean;
2556
2559
  getFriends(): string[];
2557
2560
  }
2558
2561
 
@@ -2882,6 +2885,7 @@ declare interface InfoClassDefinition extends InfoInterfaceDefinition {
2882
2885
  isFinal: boolean;
2883
2886
  interfaces: readonly InfoImplementing[];
2884
2887
  isForTesting: boolean;
2888
+ isSharedMemory: boolean;
2885
2889
  }
2886
2890
 
2887
2891
  declare interface InfoClassImplementation {
@@ -3502,6 +3506,14 @@ declare class Loop_2 implements IStatement {
3502
3506
  getMatcher(): IStatementRunnable;
3503
3507
  }
3504
3508
 
3509
+ declare class LoopAtScreen implements IStructure {
3510
+ getMatcher(): IStructureRunnable;
3511
+ }
3512
+
3513
+ declare class LoopAtScreen_2 implements IStatement {
3514
+ getMatcher(): IStatementRunnable;
3515
+ }
3516
+
3505
3517
  declare class LoopGroupBy extends Expression {
3506
3518
  getRunnable(): IStatementRunnable;
3507
3519
  }
@@ -5026,6 +5038,7 @@ declare namespace Statements {
5026
5038
  BreakId,
5027
5039
  InterfaceDeferred,
5028
5040
  While_2 as While,
5041
+ LoopAtScreen_2 as LoopAtScreen,
5029
5042
  Loop_2 as Loop,
5030
5043
  Check,
5031
5044
  EndProvide,
@@ -5425,6 +5438,7 @@ declare namespace Structures {
5425
5438
  If,
5426
5439
  InterfaceGlobal,
5427
5440
  Interface_2 as Interface,
5441
+ LoopAtScreen,
5428
5442
  Loop,
5429
5443
  Method,
5430
5444
  Module,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
3
+ exports.fail = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
4
4
  const Tokens = require("../1_lexer/tokens");
5
5
  const nodes_1 = require("../nodes");
6
6
  const version_1 = require("../../version");
@@ -572,6 +572,28 @@ class Permutation {
572
572
  return [""];
573
573
  }
574
574
  }
575
+ class FailCombinator extends Error {
576
+ }
577
+ class Fail {
578
+ listKeywords() {
579
+ return [];
580
+ }
581
+ getUsing() {
582
+ return [];
583
+ }
584
+ run(_r) {
585
+ throw new FailCombinator();
586
+ }
587
+ railroad() {
588
+ return "Railroad.Terminal('!Fail')";
589
+ }
590
+ toStr() {
591
+ return "fail()";
592
+ }
593
+ first() {
594
+ return [];
595
+ }
596
+ }
575
597
  class Alternative {
576
598
  constructor(list) {
577
599
  if (list.length < 2) {
@@ -711,18 +733,26 @@ class Combi {
711
733
  static run(runnable, tokens, version) {
712
734
  this.ver = version;
713
735
  const input = new result_1.Result(tokens, 0);
714
- const result = runnable.run([input]);
715
- /*
716
- console.log("res: " + result.length);
736
+ try {
737
+ const result = runnable.run([input]);
738
+ /*
739
+ console.log("res: " + result.length);
740
+ for (const res of result) {
741
+ console.dir(res.getNodes().map(n => n.get().constructor.name));
742
+ console.dir(res.getNodes().map(n => n.concatTokens()));
743
+ }
744
+ */
717
745
  for (const res of result) {
718
- console.dir(res.getNodes().map(n => n.get().constructor.name));
719
- console.dir(res.getNodes().map(n => n.concatTokens()));
746
+ if (res.remainingLength() === 0) {
747
+ return res.getNodes();
748
+ }
720
749
  }
721
- */
722
- for (const res of result) {
723
- if (res.remainingLength() === 0) {
724
- return res.getNodes();
750
+ }
751
+ catch (err) {
752
+ if (err instanceof FailCombinator) {
753
+ return undefined;
725
754
  }
755
+ throw err;
726
756
  }
727
757
  return undefined;
728
758
  }
@@ -824,4 +854,8 @@ function verNot(version, first) {
824
854
  return new VersNot(version, map(first));
825
855
  }
826
856
  exports.verNot = verNot;
857
+ function fail() {
858
+ return new Fail();
859
+ }
860
+ exports.fail = fail;
827
861
  //# sourceMappingURL=combi.js.map
@@ -36,6 +36,7 @@ __exportStar(require("./do"), exports);
36
36
  __exportStar(require("./break_id"), exports);
37
37
  __exportStar(require("./interface_deferred"), exports);
38
38
  __exportStar(require("./while"), exports);
39
+ __exportStar(require("./loop_at_screen"), exports);
39
40
  __exportStar(require("./loop"), exports);
40
41
  __exportStar(require("./check"), exports);
41
42
  __exportStar(require("./endprovide"), exports);
@@ -17,7 +17,7 @@ class Loop {
17
17
  const to = (0, combi_1.seq)("TO", expressions_1.Source);
18
18
  const usingKey = (0, combi_1.seq)("USING KEY", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));
19
19
  const options = (0, combi_1.per)(target, from, to, where, usingKey, group);
20
- const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
20
+ const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.seq)("SCREEN", (0, combi_1.fail)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
21
21
  return (0, combi_1.seq)("LOOP", (0, combi_1.opt)(at));
22
22
  }
23
23
  }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoopAtScreen = void 0;
4
+ const combi_1 = require("../combi");
5
+ const version_1 = require("../../../version");
6
+ const expressions_1 = require("../expressions");
7
+ class LoopAtScreen {
8
+ getMatcher() {
9
+ const l = (0, combi_1.seq)("LOOP AT SCREEN", (0, combi_1.opt)((0, combi_1.seq)("INTO", expressions_1.Target)));
10
+ return (0, combi_1.verNot)(version_1.Version.Cloud, l);
11
+ }
12
+ }
13
+ exports.LoopAtScreen = LoopAtScreen;
14
+ //# sourceMappingURL=loop_at_screen.js.map
@@ -41,6 +41,7 @@ __exportStar(require("./function_module"), exports);
41
41
  __exportStar(require("./if"), exports);
42
42
  __exportStar(require("./interface_global"), exports);
43
43
  __exportStar(require("./interface"), exports);
44
+ __exportStar(require("./loop_at_screen"), exports);
44
45
  __exportStar(require("./loop"), exports);
45
46
  __exportStar(require("./method"), exports);
46
47
  __exportStar(require("./module"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoopAtScreen = void 0;
4
+ const Statements = require("../../2_statements/statements");
5
+ const _combi_1 = require("./_combi");
6
+ const _1 = require(".");
7
+ class LoopAtScreen {
8
+ getMatcher() {
9
+ return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.LoopAtScreen), (0, _combi_1.opt)((0, _combi_1.sub)(_1.Body)), (0, _combi_1.sta)(Statements.EndLoop));
10
+ }
11
+ }
12
+ exports.LoopAtScreen = LoopAtScreen;
13
+ //# sourceMappingURL=loop_at_screen.js.map
@@ -8,7 +8,7 @@ const _statement_1 = require("../../2_statements/statements/_statement");
8
8
  class Normal {
9
9
  getMatcher() {
10
10
  // note that the sequence of alternatives here influences performance
11
- return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level
11
+ return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.LoopAtScreen), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level
12
12
  (0, _combi_1.sta)(Statements.InsertDatabase), (0, _combi_1.sta)(Statements.InsertReport), (0, _combi_1.sta)(Statements.InsertTextpool), (0, _combi_1.sta)(Statements.InsertFieldGroup), (0, _combi_1.sta)(Statements.InterfaceLoad), (0, _combi_1.sta)(Statements.Leave), (0, _combi_1.sta)(Statements.LoadReport), (0, _combi_1.sta)(Statements.Local), (0, _combi_1.sta)(Statements.With), (0, _combi_1.sta)(Statements.LogPoint), (0, _combi_1.sta)(Statements.Message), (0, _combi_1.sta)(Statements.ModifyLine), (0, _combi_1.sta)(Statements.ModifyDatabase), (0, _combi_1.sta)(Statements.ModifyInternal), (0, _combi_1.sta)(Statements.Multiply), (0, _combi_1.sta)(Statements.NewLine), (0, _combi_1.sta)(Statements.NewPage), (0, _combi_1.sta)(Statements.OpenCursor), (0, _combi_1.sta)(Statements.OpenDataset), (0, _combi_1.sta)(Statements.Overlay), (0, _combi_1.sta)(Statements.Pack), (0, _combi_1.sta)(Statements.Perform), (0, _combi_1.sta)(Statements.Position), (0, _combi_1.sta)(Statements.Put), (0, _combi_1.sta)(Statements.PrintControl), (0, _combi_1.sta)(Statements.RaiseEvent), (0, _combi_1.sta)(Statements.Raise), (0, _combi_1.sta)(Statements.Ranges), (0, _combi_1.sta)(Statements.ReadDataset), (0, _combi_1.sta)(Statements.ReadLine), (0, _combi_1.sta)(Statements.ReadReport), (0, _combi_1.sta)(Statements.ReadTextpool), (0, _combi_1.sta)(Statements.Receive), (0, _combi_1.sta)(Statements.RefreshControl), (0, _combi_1.sta)(Statements.Refresh), (0, _combi_1.sta)(Statements.Reject), (0, _combi_1.sta)(Statements.Replace), (0, _combi_1.sta)(Statements.Reserve), (0, _combi_1.sta)(Statements.Resume), (0, _combi_1.sta)(Statements.Retry), (0, _combi_1.sta)(Statements.Rollback), (0, _combi_1.sta)(Statements.Scan), (0, _combi_1.sta)(Statements.ScrollList), (0, _combi_1.sta)(Statements.Search), (0, _combi_1.sta)(Statements.SetBit), (0, _combi_1.sta)(Statements.SetBlank), (0, _combi_1.sta)(Statements.SetCountry), (0, _combi_1.sta)(Statements.SetCursor), (0, _combi_1.sta)(Statements.SetDataset), (0, _combi_1.sta)(Statements.SetExtendedCheck), (0, _combi_1.sta)(Statements.SetHandler), (0, _combi_1.sta)(Statements.SetLanguage), (0, _combi_1.sta)(Statements.SetLeft), (0, _combi_1.sta)(Statements.SetLocale), (0, _combi_1.sta)(Statements.SetMargin), (0, _combi_1.sta)(Statements.SetParameter), (0, _combi_1.sta)(Statements.SetPFStatus), (0, _combi_1.sta)(Statements.SetProperty), (0, _combi_1.sta)(Statements.SetRunTime), (0, _combi_1.sta)(Statements.SetScreen), (0, _combi_1.sta)(Statements.SetTitlebar), (0, _combi_1.sta)(Statements.SetUserCommand), (0, _combi_1.sta)(Statements.SetUpdateTask), (0, _combi_1.sta)(Statements.Shift), (0, _combi_1.sta)(Statements.Skip), (0, _combi_1.sta)(Statements.SortDataset), (0, _combi_1.sta)(Statements.Sort), (0, _combi_1.sta)(Statements.Static), (0, _combi_1.sta)(Statements.Split), (0, _combi_1.sta)(Statements.Stop), (0, _combi_1.sta)(Statements.Submit), (0, _combi_1.sta)(Statements.Summary), (0, _combi_1.sta)(Statements.SubtractCorresponding), (0, _combi_1.sta)(Statements.Subtract), (0, _combi_1.sta)(Statements.SuppressDialog), (0, _combi_1.sta)(Statements.Supply), (0, _combi_1.sta)(Statements.Sum), (0, _combi_1.sta)(Statements.SyntaxCheck), (0, _combi_1.sta)(Statements.SystemCall), (0, _combi_1.sta)(Statements.Tables), (0, _combi_1.sta)(Statements.Transfer), (0, _combi_1.sta)(Statements.Translate), (0, _combi_1.sta)(Statements.Type), (0, _combi_1.sta)(Statements.TypePools), (0, _combi_1.sta)(Statements.Uline), (0, _combi_1.sta)(Statements.Unassign), (0, _combi_1.sta)(Statements.Unpack), (0, _combi_1.sta)(Statements.UpdateDatabase), (0, _combi_1.sta)(Statements.Wait), (0, _combi_1.sta)(Statements.Window), (0, _combi_1.sta)(Statements.Write), (0, _combi_1.sta)(Statements.CommitEntities), (0, _combi_1.sta)(Statements.ModifyEntities), (0, _combi_1.sta)(Statements.ReadEntities), (0, _combi_1.sta)(Statements.RollbackEntities), (0, _combi_1.sub)(Structures.Define), (0, _combi_1.sub)(Structures.TestInjection), (0, _combi_1.sub)(Structures.TestSeam), (0, _combi_1.sub)(Structures.TypeMesh), (0, _combi_1.sub)(Structures.Provide), (0, _combi_1.sub)(Structures.CatchSystemExceptions), (0, _combi_1.sub)(Structures.At), (0, _combi_1.sub)(Structures.Constants), (0, _combi_1.sub)(Structures.Types), (0, _combi_1.sub)(Structures.Statics), (0, _combi_1.sub)(Structures.Select), (0, _combi_1.sub)(Structures.Data), (0, _combi_1.sub)(Structures.TypeEnum), (0, _combi_1.sub)(Structures.While), (0, _combi_1.sub)(Structures.With), (0, _combi_1.sub)(Structures.Do), (0, _combi_1.sub)(Structures.ExecSQL));
13
13
  }
14
14
  }
@@ -144,6 +144,7 @@ class ABAPFileInformation {
144
144
  interfaces: this.getImplementing(found),
145
145
  isForTesting: concat.includes(" FOR TESTING"),
146
146
  isAbstract: concat.includes(" ABSTRACT"),
147
+ isSharedMemory: concat.includes(" SHARED MEMORY ENABLED"),
147
148
  isFinal: found.findFirstExpression(Expressions.ClassFinal) !== undefined,
148
149
  aliases,
149
150
  attributes,
@@ -7,6 +7,33 @@ class TypeUtils {
7
7
  constructor(scope) {
8
8
  this.scope = scope;
9
9
  }
10
+ isCharLikeStrict(type) {
11
+ if (type === undefined) {
12
+ return false;
13
+ }
14
+ else if (type instanceof basic_1.StructureType) {
15
+ for (const c of type.getComponents()) {
16
+ if (this.isCharLikeStrict(c.type) === false) {
17
+ return false;
18
+ }
19
+ }
20
+ return true;
21
+ }
22
+ else if (type instanceof basic_1.StringType
23
+ || type instanceof basic_1.AnyType
24
+ || type instanceof basic_1.CharacterType
25
+ || type instanceof basic_1.CLikeType
26
+ || type instanceof basic_1.DateType
27
+ || type instanceof basic_1.CSequenceType
28
+ || type instanceof basic_1.NumericGenericType
29
+ || type instanceof basic_1.NumericType
30
+ || type instanceof basic_1.TimeType
31
+ || type instanceof basic_1.UnknownType
32
+ || type instanceof basic_1.VoidType) {
33
+ return true;
34
+ }
35
+ return false;
36
+ }
10
37
  isCharLike(type) {
11
38
  if (type === undefined) {
12
39
  return false;
@@ -10,9 +10,10 @@ const _reference_1 = require("../_reference");
10
10
  class Catch {
11
11
  runSyntax(node, scope, filename) {
12
12
  var _a, _b;
13
+ const names = new Set();
13
14
  for (const c of node.findDirectExpressions(Expressions.ClassName)) {
14
15
  const token = c.getFirstToken();
15
- const className = token.getStr();
16
+ const className = token.getStr().toUpperCase();
16
17
  const found = scope.existsObject(className);
17
18
  if (found.found === true && found.id) {
18
19
  scope.addReference(token, found.id, found.type, filename);
@@ -24,6 +25,10 @@ class Catch {
24
25
  else {
25
26
  throw new Error("CATCH, unknown class " + className);
26
27
  }
28
+ if (names.has(className)) {
29
+ throw new Error("Duplicate class name in CATCH: " + className);
30
+ }
31
+ names.add(className);
27
32
  }
28
33
  const target = node.findDirectExpression(Expressions.Target);
29
34
  const firstClassName = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoopAtScreen = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const target_1 = require("../expressions/target");
6
+ const inline_data_1 = require("../expressions/inline_data");
7
+ const basic_1 = require("../../types/basic");
8
+ class LoopAtScreen {
9
+ runSyntax(node, scope, filename) {
10
+ const target = node.findDirectExpression(Expressions.Target);
11
+ if (target) {
12
+ new target_1.Target().runSyntax(target, scope, filename);
13
+ }
14
+ const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
15
+ if (inline) {
16
+ new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("SCREEN"));
17
+ }
18
+ }
19
+ }
20
+ exports.LoopAtScreen = LoopAtScreen;
21
+ //# sourceMappingURL=loop_at_screen.js.map
@@ -6,16 +6,31 @@ const basic_1 = require("../../types/basic");
6
6
  const inline_data_1 = require("../expressions/inline_data");
7
7
  const source_1 = require("../expressions/source");
8
8
  const target_1 = require("../expressions/target");
9
+ const _type_utils_1 = require("../_type_utils");
9
10
  class Split {
10
11
  runSyntax(node, scope, filename) {
11
- const type = node.findTokenSequencePosition("INTO", "TABLE") ? new basic_1.TableType(new basic_1.StringType(), { withHeader: false }) : new basic_1.StringType();
12
+ const intoTable = node.findTokenSequencePosition("INTO", "TABLE") !== undefined;
13
+ const type = intoTable ? new basic_1.TableType(new basic_1.StringType(), { withHeader: false }) : new basic_1.StringType();
12
14
  for (const target of node.findAllExpressions(Expressions.Target)) {
13
15
  const inline = target.findDirectExpression(Expressions.InlineData);
14
16
  if (inline) {
15
17
  new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);
16
18
  }
17
19
  else {
18
- new target_1.Target().runSyntax(target, scope, filename);
20
+ let targetType = new target_1.Target().runSyntax(target, scope, filename);
21
+ if (intoTable) {
22
+ if (!(targetType instanceof basic_1.TableType)
23
+ && !(targetType instanceof basic_1.UnknownType)
24
+ && !(targetType instanceof basic_1.VoidType)) {
25
+ throw new Error("Into must be table typed");
26
+ }
27
+ if (targetType instanceof basic_1.TableType) {
28
+ targetType = targetType.getRowType();
29
+ }
30
+ }
31
+ if (new _type_utils_1.TypeUtils(scope).isCharLikeStrict(targetType) === false) {
32
+ throw new Error("Incompatible, target not character like");
33
+ }
19
34
  }
20
35
  }
21
36
  for (const s of node.findDirectExpressions(Expressions.Source)) {
@@ -130,6 +130,7 @@ const delete_cluster_1 = require("./statements/delete_cluster");
130
130
  const unassign_1 = require("./statements/unassign");
131
131
  const insert_textpool_1 = require("./statements/insert_textpool");
132
132
  const get_cursor_1 = require("./statements/get_cursor");
133
+ const loop_at_screen_1 = require("./statements/loop_at_screen");
133
134
  // -----------------------------------
134
135
  const map = {};
135
136
  function addToMap(handler) {
@@ -155,6 +156,7 @@ if (Object.keys(map).length === 0) {
155
156
  addToMap(new assert_1.Assert());
156
157
  addToMap(new catch_1.Catch());
157
158
  addToMap(new loop_1.Loop());
159
+ addToMap(new loop_at_screen_1.LoopAtScreen());
158
160
  addToMap(new set_pf_status_1.SetPFStatus());
159
161
  addToMap(new set_titlebar_1.SetTitlebar());
160
162
  addToMap(new submit_1.Submit());
@@ -43,6 +43,7 @@ class ClassDefinition extends _identifier_1.Identifier {
43
43
  scope.pop(node.getLastToken().getEnd());
44
44
  const concat = this.node.findFirstStatement(Statements.ClassDefinition).concatTokens().toUpperCase();
45
45
  this.testing = concat.includes(" FOR TESTING");
46
+ this.sharedMemory = concat.includes(" SHARED MEMORY ENABLED");
46
47
  this.abstract = concat.includes(" ABSTRACT");
47
48
  }
48
49
  getFriends() {
@@ -81,6 +82,9 @@ class ClassDefinition extends _identifier_1.Identifier {
81
82
  isAbstract() {
82
83
  return this.abstract;
83
84
  }
85
+ isSharedMemory() {
86
+ return this.sharedMemory;
87
+ }
84
88
  /*
85
89
  public getEvents() {
86
90
  }
@@ -139,6 +139,7 @@ class Indent {
139
139
  || type instanceof Statements.WhenOthers
140
140
  || type instanceof Statements.Cleanup
141
141
  || type instanceof Statements.Loop
142
+ || type instanceof Statements.LoopAtScreen
142
143
  || type instanceof Statements.CatchSystemExceptions
143
144
  || type instanceof Statements.Form
144
145
  || type instanceof Statements.Else
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.85.41";
71
+ return "2.85.44";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -15,6 +15,8 @@ class CyclicOOConf extends _basic_rule_config_1.BasicRuleConfig {
15
15
  * @uniqueItems true
16
16
  */
17
17
  this.skip = [];
18
+ /** Skips shared memory enabled classes*/
19
+ this.skipSharedMemory = true;
18
20
  }
19
21
  }
20
22
  exports.CyclicOOConf = CyclicOOConf;
@@ -41,16 +43,20 @@ class CyclicOO {
41
43
  }
42
44
  }
43
45
  initialize(reg) {
46
+ var _a;
44
47
  this.reg = reg;
45
48
  this.edges = {};
46
49
  for (const obj of this.reg.getObjectsByType("CLAS")) {
47
50
  const name = obj.getName().toUpperCase();
48
- if (!(obj instanceof _abap_object_1.ABAPObject)) {
51
+ if (!(obj instanceof objects_1.Class)) {
49
52
  continue;
50
53
  }
51
54
  else if (this.conf.skip.indexOf(name) >= 0) {
52
55
  continue;
53
56
  }
57
+ else if (this.conf.skipSharedMemory === true && ((_a = obj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.isSharedMemory) === true) {
58
+ continue;
59
+ }
54
60
  this.buildEdges(name, new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());
55
61
  }
56
62
  for (const obj of this.reg.getObjectsByType("INTF")) {
@@ -846,7 +846,7 @@ ${indentation} output = ${topTarget}.`;
846
846
  return undefined;
847
847
  }
848
848
  outlineFor(forLoop, indentation) {
849
- var _a, _b, _c, _d, _e, _f;
849
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
850
850
  let body = "";
851
851
  let end = "";
852
852
  const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();
@@ -860,12 +860,21 @@ ${indentation} output = ${topTarget}.`;
860
860
  body += indentation + ` ${field} = ${field} + 1.\n`;
861
861
  end = "ENDWHILE";
862
862
  }
863
+ else if (forLoop.findDirectTokenByText("WHILE")) {
864
+ const name = (_f = forLoop.findFirstExpression(Expressions.Field)) === null || _f === void 0 ? void 0 : _f.concatTokens();
865
+ body += indentation + "DATA " + name + " TYPE i.\n";
866
+ const cond = forLoop.findFirstExpression(Expressions.Cond);
867
+ body += indentation + `WHILE ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\n`;
868
+ const field = (_h = (_g = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _g === void 0 ? void 0 : _g.findFirstExpression(Expressions.Field)) === null || _h === void 0 ? void 0 : _h.concatTokens();
869
+ body += indentation + ` ${field} = ${field} + 1.\n`;
870
+ end = "ENDWHILE";
871
+ }
863
872
  else if (loopTargetField) {
864
873
  body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField}).\n`;
865
874
  end = "ENDLOOP";
866
875
  }
867
876
  else if (loopTargetField === undefined) {
868
- const loopTargetFieldSymbol = (_f = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens();
877
+ const loopTargetFieldSymbol = (_j = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _j === void 0 ? void 0 : _j.concatTokens();
869
878
  body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol}).\n`;
870
879
  end = "ENDLOOP";
871
880
  }
@@ -19,8 +19,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
19
19
  key: "method_overwrites_builtin",
20
20
  title: "Method name overwrites builtin function",
21
21
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
22
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm`,
23
- tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
22
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
23
+
24
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions`,
25
+ tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
24
26
  };
25
27
  }
26
28
  getConfig() {
@@ -19,6 +19,7 @@ class PragmaPlacement extends _abap_rule_1.ABAPRule {
19
19
  title: "Pragma Placement",
20
20
  shortDescription: `Place pragmas at end of statements`,
21
21
  tags: [_irule_1.RuleTag.SingleFile],
22
+ extendedInformation: `https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/abenpragma.htm`,
22
23
  badExample: `DATA field ##NO_TEXT TYPE i.`,
23
24
  goodExample: `DATA field TYPE i ##NO_TEXT.`,
24
25
  };
@@ -42,7 +43,7 @@ class PragmaPlacement extends _abap_rule_1.ABAPRule {
42
43
  }
43
44
  if (children[children.length - 2].getLastToken().getStart().isAfter(p.getStart())) {
44
45
  const message = "Place pragma at end of statement";
45
- const issue = issue_1.Issue.atStatement(file, s, message, this.getMetadata().key, this.conf.severity);
46
+ const issue = issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.conf.severity);
46
47
  issues.push(issue);
47
48
  continue; // max one finding per statement
48
49
  }
@@ -55,7 +55,7 @@ If the target is a sorted/hashed table, no issue is reported`,
55
55
  const selects = stru.findAllStatements(Statements.Select);
56
56
  selects.push(...stru.findAllStatements(Statements.SelectLoop));
57
57
  for (const s of selects) {
58
- const c = s.concatTokens();
58
+ const c = s.concatTokens().toUpperCase();
59
59
  if (c.startsWith("SELECT SINGLE ")) {
60
60
  continue;
61
61
  }
@@ -59,6 +59,9 @@ Applicable from v740sp02 and up`,
59
59
  else if (statement.findDirectExpression(expressions_1.ParameterListExceptions)) {
60
60
  continue;
61
61
  }
62
+ else if (statement.findDirectTokenByText("AREA")) {
63
+ continue;
64
+ }
62
65
  const target = ((_a = statement.findDirectExpression(expressions_1.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + "->";
63
66
  if (statement.concatTokens().includes(target)) {
64
67
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.85.41",
3
+ "version": "2.85.44",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -45,20 +45,20 @@
45
45
  },
46
46
  "homepage": "https://abaplint.org",
47
47
  "devDependencies": {
48
- "@microsoft/api-extractor": "^7.19.4",
48
+ "@microsoft/api-extractor": "^7.19.5",
49
49
  "@types/chai": "^4.3.0",
50
50
  "@types/mocha": "^9.1.0",
51
51
  "@types/node": "^17.0.21",
52
52
  "chai": "^4.3.6",
53
- "eslint": "^8.10.0",
54
- "mocha": "^9.2.1",
53
+ "eslint": "^8.11.0",
54
+ "mocha": "^9.2.2",
55
55
  "c8": "^7.11.0",
56
56
  "source-map-support": "^0.5.21",
57
57
  "ts-json-schema-generator": "^0.98.0",
58
58
  "typescript": "^4.6.2"
59
59
  },
60
60
  "dependencies": {
61
- "fast-xml-parser": "^4.0.6",
61
+ "fast-xml-parser": "^4.0.7",
62
62
  "json5": "^2.2.0",
63
63
  "vscode-languageserver-protocol": "^3.16.0",
64
64
  "vscode-languageserver-types": "^3.16.0"