@abaplint/cli 2.99.1 → 2.99.3

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/cli.js +64 -10
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -20599,6 +20599,9 @@ class CurrentScope {
20599
20599
  return undefined;
20600
20600
  }
20601
20601
  const typePoolName = name.split("_")[0];
20602
+ if (typePoolName.length !== 4) {
20603
+ return undefined;
20604
+ }
20602
20605
  const typePool = this.reg.getObject("TYPE", typePoolName);
20603
20606
  if (typePool === undefined) {
20604
20607
  return undefined;
@@ -20613,6 +20616,11 @@ class CurrentScope {
20613
20616
  return undefined;
20614
20617
  }
20615
20618
  const typePoolName = name.split("_")[0];
20619
+ if (typePoolName.length !== 4 || new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
20620
+ // this is tricky, it should not do recursion when parsing the type pool itself,
20621
+ // think about DTEL ABAP_ENCOD vs TYPE ABAP
20622
+ return undefined;
20623
+ }
20616
20624
  const typePool = this.reg.getObject("TYPE", typePoolName);
20617
20625
  if (typePool === undefined) {
20618
20626
  return undefined;
@@ -21539,7 +21547,7 @@ class TypeUtils {
21539
21547
  return false;
21540
21548
  }
21541
21549
  isAssignableStrict(source, target) {
21542
- var _a, _b;
21550
+ var _a, _b, _c, _d;
21543
21551
  /*
21544
21552
  console.dir(source);
21545
21553
  console.dir(target);
@@ -21558,6 +21566,20 @@ class TypeUtils {
21558
21566
  return false;
21559
21567
  }
21560
21568
  }
21569
+ else if (source instanceof basic_1.HexType) {
21570
+ if (target instanceof basic_1.HexType) {
21571
+ if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
21572
+ return source.getLength() <= target.getLength();
21573
+ }
21574
+ return source.getLength() === target.getLength();
21575
+ }
21576
+ else if (target instanceof basic_1.IntegerType) {
21577
+ if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
21578
+ return true;
21579
+ }
21580
+ return false;
21581
+ }
21582
+ }
21561
21583
  else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {
21562
21584
  if (this.structureContainsString(target)) {
21563
21585
  return false;
@@ -21894,7 +21916,7 @@ class BasicTypes {
21894
21916
  if (type instanceof basic_1.CharacterType
21895
21917
  && qualifiedName
21896
21918
  && qualifiedName.includes("-") === false) {
21897
- type = type.cloneType(qualifiedName);
21919
+ type = type.cloneType({ qualifiedName });
21898
21920
  }
21899
21921
  return type;
21900
21922
  }
@@ -23586,10 +23608,26 @@ class FieldChain {
23586
23608
  context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename, refType);
23587
23609
  }
23588
23610
  else if (current.get() instanceof Expressions.FieldOffset && current instanceof nodes_1.ExpressionNode) {
23589
- new field_offset_1.FieldOffset().runSyntax(current, scope, filename);
23611
+ const offset = new field_offset_1.FieldOffset().runSyntax(current, scope, filename);
23612
+ if (offset) {
23613
+ if (context instanceof basic_1.CharacterType) {
23614
+ context = new basic_1.CharacterType(context.getLength() - offset);
23615
+ }
23616
+ else if (context instanceof basic_1.HexType) {
23617
+ context = new basic_1.HexType(context.getLength() - offset);
23618
+ }
23619
+ }
23590
23620
  }
23591
23621
  else if (current.get() instanceof Expressions.FieldLength && current instanceof nodes_1.ExpressionNode) {
23592
- new field_length_1.FieldLength().runSyntax(current, scope, filename);
23622
+ const length = new field_length_1.FieldLength().runSyntax(current, scope, filename);
23623
+ if (length) {
23624
+ if (context instanceof basic_1.CharacterType) {
23625
+ context = new basic_1.CharacterType(length);
23626
+ }
23627
+ else if (context instanceof basic_1.HexType) {
23628
+ context = new basic_1.HexType(length);
23629
+ }
23630
+ }
23593
23631
  }
23594
23632
  }
23595
23633
  return context;
@@ -23652,6 +23690,15 @@ class FieldLength {
23652
23690
  const field = node.findDirectExpression(Expressions.SimpleFieldChain2);
23653
23691
  if (field) {
23654
23692
  new field_chain_1.FieldChain().runSyntax(field, scope, filename, _reference_1.ReferenceType.DataReadReference);
23693
+ return undefined;
23694
+ }
23695
+ else {
23696
+ const children = node.getChildren();
23697
+ const num = children[children.length - 2];
23698
+ if (num.getLastToken().getStr() === "*") {
23699
+ return undefined;
23700
+ }
23701
+ return parseInt(num.getLastToken().getStr(), 10);
23655
23702
  }
23656
23703
  }
23657
23704
  }
@@ -23678,6 +23725,10 @@ class FieldOffset {
23678
23725
  const field = node.findDirectExpression(Expressions.SimpleFieldChain2);
23679
23726
  if (field) {
23680
23727
  new field_chain_1.FieldChain().runSyntax(field, scope, filename, _reference_1.ReferenceType.DataReadReference);
23728
+ return undefined;
23729
+ }
23730
+ else {
23731
+ return parseInt(node.getLastToken().getStr(), 10);
23681
23732
  }
23682
23733
  }
23683
23734
  }
@@ -33874,13 +33925,16 @@ class CharacterType extends _abstract_type_1.AbstractType {
33874
33925
  }
33875
33926
  this.length = length;
33876
33927
  }
33877
- cloneType(qualifiedName, ddicName) {
33928
+ cloneType(input) {
33878
33929
  const clone = Object.assign({}, this.getAbstractTypeData()) || {};
33879
- if (qualifiedName) {
33880
- clone.qualifiedName = qualifiedName;
33930
+ if (input.qualifiedName) {
33931
+ clone.qualifiedName = input.qualifiedName;
33932
+ }
33933
+ if (input.ddicName) {
33934
+ clone.ddicName = input.ddicName;
33881
33935
  }
33882
- if (ddicName) {
33883
- clone.ddicName = ddicName;
33936
+ if (input.derivedFromConstant) {
33937
+ clone.derivedFromConstant = input.derivedFromConstant;
33884
33938
  }
33885
33939
  return new CharacterType(this.length, clone);
33886
33940
  }
@@ -47501,7 +47555,7 @@ class Registry {
47501
47555
  }
47502
47556
  static abaplintVersion() {
47503
47557
  // magic, see build script "version.sh"
47504
- return "2.99.1";
47558
+ return "2.99.3";
47505
47559
  }
47506
47560
  getDDICReferences() {
47507
47561
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.99.1",
3
+ "version": "2.99.3",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "bin": {
6
6
  "abaplint": "./abaplint"
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://abaplint.org",
39
39
  "devDependencies": {
40
- "@abaplint/core": "^2.99.1",
40
+ "@abaplint/core": "^2.99.3",
41
41
  "@types/chai": "^4.3.5",
42
42
  "@types/glob": "^7.2.0",
43
43
  "@types/minimist": "^1.2.2",