@abaplint/core 2.83.7 → 2.83.8

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 (111) hide show
  1. package/README.md +6 -6
  2. package/build/abaplint.d.ts +59 -6
  3. package/build/src/abap/flow/flow_graph.js +7 -7
  4. package/build/src/abap/types/basic/any_type.js +3 -0
  5. package/build/src/abap/types/basic/character_type.js +3 -0
  6. package/build/src/abap/types/basic/clike_type.js +3 -0
  7. package/build/src/abap/types/basic/csequence_type.js +3 -0
  8. package/build/src/abap/types/basic/data_reference_type.js +3 -0
  9. package/build/src/abap/types/basic/date_type.js +3 -0
  10. package/build/src/abap/types/basic/decfloat16_type.js +3 -0
  11. package/build/src/abap/types/basic/decfloat34_type.js +3 -0
  12. package/build/src/abap/types/basic/decfloat_type.js +3 -0
  13. package/build/src/abap/types/basic/enum_type.js +3 -0
  14. package/build/src/abap/types/basic/float_type.js +3 -0
  15. package/build/src/abap/types/basic/floating_point_type.js +3 -0
  16. package/build/src/abap/types/basic/generic_object_reference_type.js +3 -0
  17. package/build/src/abap/types/basic/hex_type.js +3 -0
  18. package/build/src/abap/types/basic/integer_type.js +3 -0
  19. package/build/src/abap/types/basic/numeric_generic_type.js +3 -0
  20. package/build/src/abap/types/basic/numeric_type.js +3 -0
  21. package/build/src/abap/types/basic/object_reference_type.js +3 -0
  22. package/build/src/abap/types/basic/packed_type.js +3 -0
  23. package/build/src/abap/types/basic/simple_type.js +3 -0
  24. package/build/src/abap/types/basic/string_type.js +3 -0
  25. package/build/src/abap/types/basic/structure_type.js +3 -0
  26. package/build/src/abap/types/basic/table_type.js +3 -0
  27. package/build/src/abap/types/basic/time_type.js +3 -0
  28. package/build/src/abap/types/basic/unknown_type.js +3 -0
  29. package/build/src/abap/types/basic/utc_long_type.js +3 -0
  30. package/build/src/abap/types/basic/void_type.js +3 -0
  31. package/build/src/abap/types/basic/xsequence_type.js +3 -0
  32. package/build/src/abap/types/basic/xstring_type.js +3 -0
  33. package/build/src/cds/cds_determine_types.js +23 -0
  34. package/build/src/cds/expressions/cds_association.js +1 -1
  35. package/build/src/cds/expressions/cds_composition.js +1 -1
  36. package/build/src/cds/expressions/cds_relation.js +12 -0
  37. package/build/src/cds/expressions/index.js +1 -0
  38. package/build/src/index.js +3 -1
  39. package/build/src/lsp/help.js +17 -12
  40. package/build/src/objects/data_definition.js +59 -42
  41. package/build/src/registry.js +1 -1
  42. package/build/src/rules/7bit_ascii.js +2 -2
  43. package/build/src/rules/abapdoc.js +1 -1
  44. package/build/src/rules/align_parameters.js +33 -33
  45. package/build/src/rules/ambiguous_statement.js +5 -5
  46. package/build/src/rules/avoid_use.js +6 -6
  47. package/build/src/rules/begin_end_names.js +4 -4
  48. package/build/src/rules/begin_single_include.js +12 -12
  49. package/build/src/rules/call_transaction_authority_check.js +3 -3
  50. package/build/src/rules/chain_mainly_declarations.js +4 -4
  51. package/build/src/rules/check_abstract.js +2 -2
  52. package/build/src/rules/check_comments.js +6 -5
  53. package/build/src/rules/check_include.js +3 -3
  54. package/build/src/rules/check_no_handler_pragma.js +8 -8
  55. package/build/src/rules/check_subrc.js +8 -8
  56. package/build/src/rules/commented_code.js +1 -1
  57. package/build/src/rules/constructor_visibility_public.js +4 -4
  58. package/build/src/rules/contains_tab.js +2 -2
  59. package/build/src/rules/dangerous_statement.js +1 -1
  60. package/build/src/rules/downport.js +35 -35
  61. package/build/src/rules/exit_or_check.js +3 -3
  62. package/build/src/rules/exporting.js +1 -1
  63. package/build/src/rules/forbidden_identifier.js +1 -1
  64. package/build/src/rules/forbidden_void_type.js +2 -2
  65. package/build/src/rules/functional_writing.js +17 -17
  66. package/build/src/rules/global_class.js +10 -10
  67. package/build/src/rules/identical_conditions.js +2 -2
  68. package/build/src/rules/identical_contents.js +15 -15
  69. package/build/src/rules/identical_descriptions.js +4 -4
  70. package/build/src/rules/if_in_if.js +7 -7
  71. package/build/src/rules/implement_methods.js +3 -3
  72. package/build/src/rules/in_statement_indentation.js +11 -11
  73. package/build/src/rules/intf_referencing_clas.js +3 -3
  74. package/build/src/rules/line_break_style.js +2 -2
  75. package/build/src/rules/line_length.js +1 -1
  76. package/build/src/rules/line_only_punc.js +1 -1
  77. package/build/src/rules/local_variable_names.js +2 -2
  78. package/build/src/rules/many_parentheses.js +10 -10
  79. package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
  80. package/build/src/rules/max_one_statement.js +3 -3
  81. package/build/src/rules/nesting.js +1 -1
  82. package/build/src/rules/no_chained_assignment.js +1 -1
  83. package/build/src/rules/no_public_attributes.js +1 -1
  84. package/build/src/rules/no_yoda_conditions.js +4 -4
  85. package/build/src/rules/obsolete_statement.js +40 -40
  86. package/build/src/rules/omit_parameter_name.js +3 -3
  87. package/build/src/rules/omit_receiving.js +13 -13
  88. package/build/src/rules/parser_702_chaining.js +2 -2
  89. package/build/src/rules/parser_error.js +2 -2
  90. package/build/src/rules/parser_missing_space.js +1 -1
  91. package/build/src/rules/prefer_inline.js +16 -16
  92. package/build/src/rules/prefer_is_not.js +7 -7
  93. package/build/src/rules/prefer_raise_exception_new.js +3 -3
  94. package/build/src/rules/prefer_returning_to_exporting.js +1 -1
  95. package/build/src/rules/prefer_xsdbool.js +2 -2
  96. package/build/src/rules/remove_descriptions.js +4 -4
  97. package/build/src/rules/rfc_error_handling.js +9 -9
  98. package/build/src/rules/select_add_order_by.js +5 -5
  99. package/build/src/rules/select_performance.js +2 -2
  100. package/build/src/rules/sicf_consistency.js +4 -4
  101. package/build/src/rules/space_before_dot.js +2 -2
  102. package/build/src/rules/start_at_tab.js +1 -1
  103. package/build/src/rules/sy_modification.js +2 -2
  104. package/build/src/rules/tabl_enhancement_category.js +2 -2
  105. package/build/src/rules/unused_methods.js +9 -9
  106. package/build/src/rules/unused_variables.js +6 -6
  107. package/build/src/rules/use_bool_expression.js +8 -8
  108. package/build/src/rules/use_line_exists.js +6 -6
  109. package/build/src/rules/use_new.js +2 -2
  110. package/build/src/rules/when_others_last.js +6 -6
  111. package/package.json +66 -66
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # @abaplint/core
2
-
3
- [abaplint](https://abaplint.org/) core library
4
-
5
- Exposes functionallity like the parser and rules, which can be used in other projects.
6
-
1
+ # @abaplint/core
2
+
3
+ [abaplint](https://abaplint.org/) core library
4
+
5
+ Exposes functionallity like the parser and rules, which can be used in other projects.
6
+
7
7
  For more information see https://github.com/abaplint/abaplint
@@ -101,6 +101,7 @@ export declare abstract class AbstractType {
101
101
  getQualifiedName(): string | undefined;
102
102
  abstract toText(level: number): string;
103
103
  abstract toABAP(): string;
104
+ abstract toCDS(): string;
104
105
  abstract isGeneric(): boolean;
105
106
  abstract containsVoid(): boolean;
106
107
  }
@@ -147,6 +148,7 @@ declare class AnyType extends AbstractType {
147
148
  toABAP(): string;
148
149
  isGeneric(): boolean;
149
150
  containsVoid(): boolean;
151
+ toCDS(): string;
150
152
  }
151
153
 
152
154
  declare class Append implements IStatement {
@@ -558,6 +560,10 @@ declare class CDSMetadataExtension extends AbstractObject {
558
560
  getDescription(): string | undefined;
559
561
  }
560
562
 
563
+ export declare class CDSParser {
564
+ parse(file: IFile | undefined): ExpressionNode | undefined;
565
+ }
566
+
561
567
  declare class ChangeDocument extends AbstractObject {
562
568
  getType(): string;
563
569
  getAllowedNaming(): {
@@ -585,6 +591,7 @@ declare class CharacterType extends AbstractType {
585
591
  isGeneric(): boolean;
586
592
  containsVoid(): boolean;
587
593
  getIdentifier(): undefined;
594
+ toCDS(): string;
588
595
  }
589
596
 
590
597
  declare class Check implements IStatement {
@@ -775,6 +782,7 @@ declare class CLikeType extends AbstractType {
775
782
  isGeneric(): boolean;
776
783
  toABAP(): string;
777
784
  containsVoid(): boolean;
785
+ toCDS(): string;
778
786
  }
779
787
 
780
788
  declare class CloseCursor implements IStatement {
@@ -986,6 +994,7 @@ declare class CSequenceType extends AbstractType {
986
994
  isGeneric(): boolean;
987
995
  toABAP(): string;
988
996
  containsVoid(): boolean;
997
+ toCDS(): string;
989
998
  }
990
999
 
991
1000
  export declare class CurrentScope {
@@ -1113,10 +1122,8 @@ declare class DataControl extends AbstractObject {
1113
1122
  }
1114
1123
 
1115
1124
  declare class DataDefinition extends AbstractObject {
1116
- private sqlViewName;
1117
1125
  private parserError;
1118
- private fieldNames;
1119
- private sources;
1126
+ private parsedData;
1120
1127
  getType(): string;
1121
1128
  getAllowedNaming(): {
1122
1129
  maxLength: number;
@@ -1124,17 +1131,18 @@ declare class DataDefinition extends AbstractObject {
1124
1131
  };
1125
1132
  getSQLViewName(): string | undefined;
1126
1133
  getDescription(): string | undefined;
1127
- parseType(_reg: IRegistry): AbstractType;
1134
+ parseType(reg: IRegistry): AbstractType;
1128
1135
  listSources(): {
1129
1136
  name: string;
1130
1137
  as: string | undefined;
1131
- }[];
1138
+ }[] | undefined;
1132
1139
  setDirty(): void;
1133
1140
  findSourceFile(): IFile | undefined;
1134
1141
  hasParserError(): boolean | undefined;
1135
1142
  parse(): IParseResult;
1143
+ private findSQLViewName;
1136
1144
  private findFieldNames;
1137
- private findSources;
1145
+ private findSourcesAndRelations;
1138
1146
  }
1139
1147
 
1140
1148
  declare class DataDefinition_2 extends Expression {
@@ -1170,6 +1178,7 @@ declare class DataReference extends AbstractType {
1170
1178
  toABAP(): string;
1171
1179
  isGeneric(): boolean;
1172
1180
  containsVoid(): boolean;
1181
+ toCDS(): string;
1173
1182
  }
1174
1183
 
1175
1184
  declare class DateType extends AbstractType {
@@ -1177,6 +1186,7 @@ declare class DateType extends AbstractType {
1177
1186
  isGeneric(): boolean;
1178
1187
  toABAP(): string;
1179
1188
  containsVoid(): boolean;
1189
+ toCDS(): string;
1180
1190
  }
1181
1191
 
1182
1192
  declare class DDIC {
@@ -1214,6 +1224,7 @@ declare class DecFloat16Type extends AbstractType {
1214
1224
  isGeneric(): boolean;
1215
1225
  toABAP(): string;
1216
1226
  containsVoid(): boolean;
1227
+ toCDS(): string;
1217
1228
  }
1218
1229
 
1219
1230
  declare class DecFloat34Type extends AbstractType {
@@ -1221,6 +1232,7 @@ declare class DecFloat34Type extends AbstractType {
1221
1232
  isGeneric(): boolean;
1222
1233
  toABAP(): string;
1223
1234
  containsVoid(): boolean;
1235
+ toCDS(): string;
1224
1236
  }
1225
1237
 
1226
1238
  declare class DecFloatType extends AbstractType {
@@ -1228,6 +1240,7 @@ declare class DecFloatType extends AbstractType {
1228
1240
  isGeneric(): boolean;
1229
1241
  toABAP(): string;
1230
1242
  containsVoid(): boolean;
1243
+ toCDS(): string;
1231
1244
  }
1232
1245
 
1233
1246
  declare class Decimals extends Expression {
@@ -1919,6 +1932,7 @@ declare class FloatingPointType extends AbstractType {
1919
1932
  toABAP(): string;
1920
1933
  isGeneric(): boolean;
1921
1934
  containsVoid(): boolean;
1935
+ toCDS(): string;
1922
1936
  }
1923
1937
 
1924
1938
  declare class FloatType extends AbstractType {
@@ -1926,6 +1940,7 @@ declare class FloatType extends AbstractType {
1926
1940
  isGeneric(): boolean;
1927
1941
  toABAP(): string;
1928
1942
  containsVoid(): boolean;
1943
+ toCDS(): string;
1929
1944
  }
1930
1945
 
1931
1946
  declare class For extends Expression {
@@ -2202,6 +2217,7 @@ declare class GenericObjectReferenceType extends AbstractType {
2202
2217
  isGeneric(): boolean;
2203
2218
  toABAP(): string;
2204
2219
  containsVoid(): boolean;
2220
+ toCDS(): string;
2205
2221
  }
2206
2222
 
2207
2223
  declare class Get implements IStatement {
@@ -2260,6 +2276,7 @@ declare class HexType extends AbstractType {
2260
2276
  toABAP(): string;
2261
2277
  isGeneric(): boolean;
2262
2278
  containsVoid(): boolean;
2279
+ toCDS(): string;
2263
2280
  }
2264
2281
 
2265
2282
  declare class Hide implements IStatement {
@@ -2845,6 +2862,7 @@ declare class IntegerType extends AbstractType {
2845
2862
  isGeneric(): boolean;
2846
2863
  toABAP(): string;
2847
2864
  containsVoid(): boolean;
2865
+ toCDS(): string;
2848
2866
  }
2849
2867
 
2850
2868
  declare class Interface extends ABAPObject {
@@ -3642,6 +3660,7 @@ declare class NumericGenericType extends AbstractType {
3642
3660
  isGeneric(): boolean;
3643
3661
  toABAP(): string;
3644
3662
  containsVoid(): boolean;
3663
+ toCDS(): string;
3645
3664
  }
3646
3665
 
3647
3666
  declare class NumericType extends AbstractType {
@@ -3652,6 +3671,7 @@ declare class NumericType extends AbstractType {
3652
3671
  toABAP(): string;
3653
3672
  isGeneric(): boolean;
3654
3673
  containsVoid(): boolean;
3674
+ toCDS(): string;
3655
3675
  }
3656
3676
 
3657
3677
  declare class ObjectCharacteristic extends AbstractObject {
@@ -3672,6 +3692,7 @@ declare class ObjectReferenceType extends AbstractType {
3672
3692
  isGeneric(): boolean;
3673
3693
  containsVoid(): boolean;
3674
3694
  getIdentifier(): Identifier;
3695
+ toCDS(): string;
3675
3696
  }
3676
3697
 
3677
3698
  declare namespace Objects {
@@ -3704,6 +3725,7 @@ declare namespace Objects {
3704
3725
  CustomizingImgActivity,
3705
3726
  CustomizingTransaction,
3706
3727
  DataControl,
3728
+ ParsedDataDefinition,
3707
3729
  DataDefinition,
3708
3730
  DataElement,
3709
3731
  DialogModule,
@@ -3848,6 +3870,7 @@ declare class PackedType extends AbstractType {
3848
3870
  toABAP(): string;
3849
3871
  isGeneric(): boolean;
3850
3872
  containsVoid(): boolean;
3873
+ toCDS(): string;
3851
3874
  }
3852
3875
 
3853
3876
  declare class Parameter extends AbstractObject {
@@ -3907,6 +3930,26 @@ declare class ParenRightW extends Token {
3907
3930
  static railroad(): string;
3908
3931
  }
3909
3932
 
3933
+ declare type ParsedDataDefinition = {
3934
+ sqlViewName: string | undefined;
3935
+ fields: {
3936
+ name: string;
3937
+ }[];
3938
+ sources: {
3939
+ name: string;
3940
+ as: string | undefined;
3941
+ }[];
3942
+ associations: {
3943
+ name: string;
3944
+ as: string | undefined;
3945
+ }[];
3946
+ relations: {
3947
+ name: string;
3948
+ as: string | undefined;
3949
+ }[];
3950
+ tree: ExpressionNode | undefined;
3951
+ };
3952
+
3910
3953
  declare class PassByValue extends Expression {
3911
3954
  getRunnable(): IStatementRunnable;
3912
3955
  }
@@ -4523,6 +4566,7 @@ declare class SimpleType extends AbstractType {
4523
4566
  toABAP(): string;
4524
4567
  isGeneric(): boolean;
4525
4568
  containsVoid(): boolean;
4569
+ toCDS(): string;
4526
4570
  }
4527
4571
 
4528
4572
  declare class Skip implements IStatement {
@@ -5124,6 +5168,7 @@ declare class StringType extends AbstractType {
5124
5168
  isGeneric(): boolean;
5125
5169
  toABAP(): string;
5126
5170
  containsVoid(): boolean;
5171
+ toCDS(): string;
5127
5172
  }
5128
5173
 
5129
5174
  declare class StructureNode extends AbstractNode<StructureNode | StatementNode> {
@@ -5215,6 +5260,7 @@ declare class StructureType extends AbstractType {
5215
5260
  isGeneric(): boolean;
5216
5261
  toABAP(): string;
5217
5262
  containsVoid(): boolean;
5263
+ toCDS(): string;
5218
5264
  }
5219
5265
 
5220
5266
  declare class Submit implements IStatement {
@@ -5365,6 +5411,7 @@ declare class TableType_2 extends AbstractType {
5365
5411
  toText(level: number): string;
5366
5412
  isGeneric(): boolean;
5367
5413
  containsVoid(): boolean;
5414
+ toCDS(): string;
5368
5415
  }
5369
5416
 
5370
5417
  declare class Target extends Expression {
@@ -5425,6 +5472,7 @@ declare class TimeType extends AbstractType {
5425
5472
  isGeneric(): boolean;
5426
5473
  toABAP(): string;
5427
5474
  containsVoid(): boolean;
5475
+ toCDS(): string;
5428
5476
  }
5429
5477
 
5430
5478
  export declare abstract class Token {
@@ -5717,6 +5765,7 @@ declare class UnknownType extends AbstractType {
5717
5765
  toABAP(): string;
5718
5766
  isGeneric(): boolean;
5719
5767
  containsVoid(): boolean;
5768
+ toCDS(): string;
5720
5769
  }
5721
5770
 
5722
5771
  declare class Unpack implements IStatement {
@@ -5732,6 +5781,7 @@ declare class UTCLongType extends AbstractType {
5732
5781
  isGeneric(): boolean;
5733
5782
  toABAP(): string;
5734
5783
  containsVoid(): boolean;
5784
+ toCDS(): string;
5735
5785
  }
5736
5786
 
5737
5787
  declare class Value extends Expression {
@@ -5813,6 +5863,7 @@ declare class VoidType extends AbstractType {
5813
5863
  toText(): string;
5814
5864
  isGeneric(): boolean;
5815
5865
  containsVoid(): boolean;
5866
+ toCDS(): string;
5816
5867
  }
5817
5868
 
5818
5869
  declare class Wait implements IStatement {
@@ -5994,6 +6045,7 @@ declare class XSequenceType extends AbstractType {
5994
6045
  isGeneric(): boolean;
5995
6046
  toABAP(): string;
5996
6047
  containsVoid(): boolean;
6048
+ toCDS(): string;
5997
6049
  }
5998
6050
 
5999
6051
  declare class XStringType extends AbstractType {
@@ -6001,6 +6053,7 @@ declare class XStringType extends AbstractType {
6001
6053
  isGeneric(): boolean;
6002
6054
  toABAP(): string;
6003
6055
  containsVoid(): boolean;
6056
+ toCDS(): string;
6004
6057
  }
6005
6058
 
6006
6059
  export { }
@@ -72,13 +72,13 @@ class FlowGraph {
72
72
  this.label = label;
73
73
  }
74
74
  toDigraph() {
75
- return `digraph G {
76
- labelloc="t";
77
- label="${this.label}";
78
- graph [fontname = "helvetica"];
79
- node [fontname = "helvetica", shape="box"];
80
- edge [fontname = "helvetica"];
81
- ${this.toTextEdges()}
75
+ return `digraph G {
76
+ labelloc="t";
77
+ label="${this.label}";
78
+ graph [fontname = "helvetica"];
79
+ node [fontname = "helvetica", shape="box"];
80
+ edge [fontname = "helvetica"];
81
+ ${this.toTextEdges()}
82
82
  }`;
83
83
  }
84
84
  listSources(node) {
@@ -15,6 +15,9 @@ class AnyType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_ANY";
20
+ }
18
21
  }
19
22
  exports.AnyType = AnyType;
20
23
  //# sourceMappingURL=any_type.js.map
@@ -28,6 +28,9 @@ class CharacterType extends _abstract_type_1.AbstractType {
28
28
  getIdentifier() {
29
29
  return undefined;
30
30
  }
31
+ toCDS() {
32
+ return "abap.char( " + this.getLength() + " )";
33
+ }
31
34
  }
32
35
  exports.CharacterType = CharacterType;
33
36
  //# sourceMappingURL=character_type.js.map
@@ -15,6 +15,9 @@ class CLikeType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_CLIKE";
20
+ }
18
21
  }
19
22
  exports.CLikeType = CLikeType;
20
23
  //# sourceMappingURL=clike_type.js.map
@@ -15,6 +15,9 @@ class CSequenceType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_CSEQUENCE";
20
+ }
18
21
  }
19
22
  exports.CSequenceType = CSequenceType;
20
23
  //# sourceMappingURL=csequence_type.js.map
@@ -22,6 +22,9 @@ class DataReference extends _abstract_type_1.AbstractType {
22
22
  containsVoid() {
23
23
  return this.type.containsVoid();
24
24
  }
25
+ toCDS() {
26
+ return "abap.TODO_REFERENCE";
27
+ }
25
28
  }
26
29
  exports.DataReference = DataReference;
27
30
  //# sourceMappingURL=data_reference_type.js.map
@@ -15,6 +15,9 @@ class DateType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.dats";
20
+ }
18
21
  }
19
22
  exports.DateType = DateType;
20
23
  //# sourceMappingURL=date_type.js.map
@@ -15,6 +15,9 @@ class DecFloat16Type extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_DECFLOAT16";
20
+ }
18
21
  }
19
22
  exports.DecFloat16Type = DecFloat16Type;
20
23
  //# sourceMappingURL=decfloat16_type.js.map
@@ -15,6 +15,9 @@ class DecFloat34Type extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_DECFLOAT34";
20
+ }
18
21
  }
19
22
  exports.DecFloat34Type = DecFloat34Type;
20
23
  //# sourceMappingURL=decfloat34_type.js.map
@@ -15,6 +15,9 @@ class DecFloatType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.fltp";
20
+ }
18
21
  }
19
22
  exports.DecFloatType = DecFloatType;
20
23
  //# sourceMappingURL=decfloat_type.js.map
@@ -15,6 +15,9 @@ class EnumType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_ENUM";
20
+ }
18
21
  }
19
22
  exports.EnumType = EnumType;
20
23
  //# sourceMappingURL=enum_type.js.map
@@ -17,6 +17,9 @@ class FloatType extends _abstract_type_1.AbstractType {
17
17
  containsVoid() {
18
18
  return false;
19
19
  }
20
+ toCDS() {
21
+ return "abap.fltp";
22
+ }
20
23
  }
21
24
  exports.FloatType = FloatType;
22
25
  //# sourceMappingURL=float_type.js.map
@@ -26,6 +26,9 @@ class FloatingPointType extends _abstract_type_1.AbstractType {
26
26
  containsVoid() {
27
27
  return false;
28
28
  }
29
+ toCDS() {
30
+ return "abap.fltp";
31
+ }
29
32
  }
30
33
  exports.FloatingPointType = FloatingPointType;
31
34
  //# sourceMappingURL=floating_point_type.js.map
@@ -15,6 +15,9 @@ class GenericObjectReferenceType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_GENERICOBJECTREF";
20
+ }
18
21
  }
19
22
  exports.GenericObjectReferenceType = GenericObjectReferenceType;
20
23
  //# sourceMappingURL=generic_object_reference_type.js.map
@@ -25,6 +25,9 @@ class HexType extends _abstract_type_1.AbstractType {
25
25
  containsVoid() {
26
26
  return false;
27
27
  }
28
+ toCDS() {
29
+ return "abap.raw( " + this.getLength() + " )";
30
+ }
28
31
  }
29
32
  exports.HexType = HexType;
30
33
  //# sourceMappingURL=hex_type.js.map
@@ -15,6 +15,9 @@ class IntegerType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.int4";
20
+ }
18
21
  }
19
22
  exports.IntegerType = IntegerType;
20
23
  //# sourceMappingURL=integer_type.js.map
@@ -15,6 +15,9 @@ class NumericGenericType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_NUMERICGENERIC";
20
+ }
18
21
  }
19
22
  exports.NumericGenericType = NumericGenericType;
20
23
  //# sourceMappingURL=numeric_generic_type.js.map
@@ -25,6 +25,9 @@ class NumericType extends _abstract_type_1.AbstractType {
25
25
  containsVoid() {
26
26
  return false;
27
27
  }
28
+ toCDS() {
29
+ return "abap.numc( " + this.getLength() + " )";
30
+ }
28
31
  }
29
32
  exports.NumericType = NumericType;
30
33
  //# sourceMappingURL=numeric_type.js.map
@@ -26,6 +26,9 @@ class ObjectReferenceType extends _abstract_type_1.AbstractType {
26
26
  getIdentifier() {
27
27
  return this.identifier;
28
28
  }
29
+ toCDS() {
30
+ return "abap.TODO_OBJECTREF";
31
+ }
29
32
  }
30
33
  exports.ObjectReferenceType = ObjectReferenceType;
31
34
  //# sourceMappingURL=object_reference_type.js.map
@@ -32,6 +32,9 @@ class PackedType extends _abstract_type_1.AbstractType {
32
32
  containsVoid() {
33
33
  return false;
34
34
  }
35
+ toCDS() {
36
+ return "abap.TODO_PACKED";
37
+ }
35
38
  }
36
39
  exports.PackedType = PackedType;
37
40
  //# sourceMappingURL=packed_type.js.map
@@ -15,6 +15,9 @@ class SimpleType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_SIMPLE";
20
+ }
18
21
  }
19
22
  exports.SimpleType = SimpleType;
20
23
  //# sourceMappingURL=simple_type.js.map
@@ -15,6 +15,9 @@ class StringType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_STRING";
20
+ }
18
21
  }
19
22
  exports.StringType = StringType;
20
23
  //# sourceMappingURL=string_type.js.map
@@ -45,6 +45,9 @@ class StructureType extends _abstract_type_1.AbstractType {
45
45
  containsVoid() {
46
46
  return this.getComponents().some(c => { c.type.containsVoid(); });
47
47
  }
48
+ toCDS() {
49
+ return "abap.TODO_STRUCTURE";
50
+ }
48
51
  }
49
52
  exports.StructureType = StructureType;
50
53
  //# sourceMappingURL=structure_type.js.map
@@ -47,6 +47,9 @@ class TableType extends _abstract_type_1.AbstractType {
47
47
  containsVoid() {
48
48
  return this.rowType.containsVoid();
49
49
  }
50
+ toCDS() {
51
+ return "abap.TODO_TABLE";
52
+ }
50
53
  }
51
54
  exports.TableType = TableType;
52
55
  //# sourceMappingURL=table_type.js.map
@@ -15,6 +15,9 @@ class TimeType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.tims";
20
+ }
18
21
  }
19
22
  exports.TimeType = TimeType;
20
23
  //# sourceMappingURL=time_type.js.map
@@ -22,6 +22,9 @@ class UnknownType extends _abstract_type_1.AbstractType {
22
22
  containsVoid() {
23
23
  return false;
24
24
  }
25
+ toCDS() {
26
+ return "abap.TODO_UNKNOWN";
27
+ }
25
28
  }
26
29
  exports.UnknownType = UnknownType;
27
30
  //# sourceMappingURL=unknown_type.js.map
@@ -15,6 +15,9 @@ class UTCLongType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_UTCLONG";
20
+ }
18
21
  }
19
22
  exports.UTCLongType = UTCLongType;
20
23
  //# sourceMappingURL=utc_long_type.js.map
@@ -22,6 +22,9 @@ class VoidType extends _abstract_type_1.AbstractType {
22
22
  containsVoid() {
23
23
  return true;
24
24
  }
25
+ toCDS() {
26
+ return "abap.TODO_VOID";
27
+ }
25
28
  }
26
29
  exports.VoidType = VoidType;
27
30
  //# sourceMappingURL=void_type.js.map
@@ -15,6 +15,9 @@ class XSequenceType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_XSEQUENCE";
20
+ }
18
21
  }
19
22
  exports.XSequenceType = XSequenceType;
20
23
  //# sourceMappingURL=xsequence_type.js.map
@@ -15,6 +15,9 @@ class XStringType extends _abstract_type_1.AbstractType {
15
15
  containsVoid() {
16
16
  return false;
17
17
  }
18
+ toCDS() {
19
+ return "abap.TODO_XSTRING";
20
+ }
18
21
  }
19
22
  exports.XStringType = XStringType;
20
23
  //# sourceMappingURL=xstring_type.js.map
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDetermineTypes = void 0;
4
+ const basic_1 = require("../abap/types/basic");
5
+ class CDSDetermineTypes {
6
+ parseType(_reg, parsedData) {
7
+ if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
8
+ return new basic_1.VoidType("DDLS:todo");
9
+ }
10
+ else {
11
+ const components = [];
12
+ for (const f of (parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields) || []) {
13
+ components.push({
14
+ name: f.name,
15
+ type: new basic_1.VoidType("DDLS:fieldname"),
16
+ });
17
+ }
18
+ return new basic_1.StructureType(components);
19
+ }
20
+ }
21
+ }
22
+ exports.CDSDetermineTypes = CDSDetermineTypes;
23
+ //# sourceMappingURL=cds_determine_types.js.map