@abaplint/cli 2.99.1 → 2.99.2

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 +56 -10
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -21539,7 +21539,7 @@ class TypeUtils {
21539
21539
  return false;
21540
21540
  }
21541
21541
  isAssignableStrict(source, target) {
21542
- var _a, _b;
21542
+ var _a, _b, _c, _d;
21543
21543
  /*
21544
21544
  console.dir(source);
21545
21545
  console.dir(target);
@@ -21558,6 +21558,20 @@ class TypeUtils {
21558
21558
  return false;
21559
21559
  }
21560
21560
  }
21561
+ else if (source instanceof basic_1.HexType) {
21562
+ if (target instanceof basic_1.HexType) {
21563
+ if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
21564
+ return source.getLength() <= target.getLength();
21565
+ }
21566
+ return source.getLength() === target.getLength();
21567
+ }
21568
+ else if (target instanceof basic_1.IntegerType) {
21569
+ if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
21570
+ return true;
21571
+ }
21572
+ return false;
21573
+ }
21574
+ }
21561
21575
  else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {
21562
21576
  if (this.structureContainsString(target)) {
21563
21577
  return false;
@@ -21894,7 +21908,7 @@ class BasicTypes {
21894
21908
  if (type instanceof basic_1.CharacterType
21895
21909
  && qualifiedName
21896
21910
  && qualifiedName.includes("-") === false) {
21897
- type = type.cloneType(qualifiedName);
21911
+ type = type.cloneType({ qualifiedName });
21898
21912
  }
21899
21913
  return type;
21900
21914
  }
@@ -23586,10 +23600,26 @@ class FieldChain {
23586
23600
  context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename, refType);
23587
23601
  }
23588
23602
  else if (current.get() instanceof Expressions.FieldOffset && current instanceof nodes_1.ExpressionNode) {
23589
- new field_offset_1.FieldOffset().runSyntax(current, scope, filename);
23603
+ const offset = new field_offset_1.FieldOffset().runSyntax(current, scope, filename);
23604
+ if (offset) {
23605
+ if (context instanceof basic_1.CharacterType) {
23606
+ context = new basic_1.CharacterType(context.getLength() - offset);
23607
+ }
23608
+ else if (context instanceof basic_1.HexType) {
23609
+ context = new basic_1.HexType(context.getLength() - offset);
23610
+ }
23611
+ }
23590
23612
  }
23591
23613
  else if (current.get() instanceof Expressions.FieldLength && current instanceof nodes_1.ExpressionNode) {
23592
- new field_length_1.FieldLength().runSyntax(current, scope, filename);
23614
+ const length = new field_length_1.FieldLength().runSyntax(current, scope, filename);
23615
+ if (length) {
23616
+ if (context instanceof basic_1.CharacterType) {
23617
+ context = new basic_1.CharacterType(length);
23618
+ }
23619
+ else if (context instanceof basic_1.HexType) {
23620
+ context = new basic_1.HexType(length);
23621
+ }
23622
+ }
23593
23623
  }
23594
23624
  }
23595
23625
  return context;
@@ -23652,6 +23682,15 @@ class FieldLength {
23652
23682
  const field = node.findDirectExpression(Expressions.SimpleFieldChain2);
23653
23683
  if (field) {
23654
23684
  new field_chain_1.FieldChain().runSyntax(field, scope, filename, _reference_1.ReferenceType.DataReadReference);
23685
+ return undefined;
23686
+ }
23687
+ else {
23688
+ const children = node.getChildren();
23689
+ const num = children[children.length - 2];
23690
+ if (num.getLastToken().getStr() === "*") {
23691
+ return undefined;
23692
+ }
23693
+ return parseInt(num.getLastToken().getStr(), 10);
23655
23694
  }
23656
23695
  }
23657
23696
  }
@@ -23678,6 +23717,10 @@ class FieldOffset {
23678
23717
  const field = node.findDirectExpression(Expressions.SimpleFieldChain2);
23679
23718
  if (field) {
23680
23719
  new field_chain_1.FieldChain().runSyntax(field, scope, filename, _reference_1.ReferenceType.DataReadReference);
23720
+ return undefined;
23721
+ }
23722
+ else {
23723
+ return parseInt(node.getLastToken().getStr(), 10);
23681
23724
  }
23682
23725
  }
23683
23726
  }
@@ -33874,13 +33917,16 @@ class CharacterType extends _abstract_type_1.AbstractType {
33874
33917
  }
33875
33918
  this.length = length;
33876
33919
  }
33877
- cloneType(qualifiedName, ddicName) {
33920
+ cloneType(input) {
33878
33921
  const clone = Object.assign({}, this.getAbstractTypeData()) || {};
33879
- if (qualifiedName) {
33880
- clone.qualifiedName = qualifiedName;
33922
+ if (input.qualifiedName) {
33923
+ clone.qualifiedName = input.qualifiedName;
33924
+ }
33925
+ if (input.ddicName) {
33926
+ clone.ddicName = input.ddicName;
33881
33927
  }
33882
- if (ddicName) {
33883
- clone.ddicName = ddicName;
33928
+ if (input.derivedFromConstant) {
33929
+ clone.derivedFromConstant = input.derivedFromConstant;
33884
33930
  }
33885
33931
  return new CharacterType(this.length, clone);
33886
33932
  }
@@ -47501,7 +47547,7 @@ class Registry {
47501
47547
  }
47502
47548
  static abaplintVersion() {
47503
47549
  // magic, see build script "version.sh"
47504
- return "2.99.1";
47550
+ return "2.99.2";
47505
47551
  }
47506
47552
  getDDICReferences() {
47507
47553
  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.2",
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.2",
41
41
  "@types/chai": "^4.3.5",
42
42
  "@types/glob": "^7.2.0",
43
43
  "@types/minimist": "^1.2.2",