expressir 2.0.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -13
  3. data/.rubocop_todo.yml +78 -1
  4. data/Gemfile +1 -2
  5. data/README.adoc +46 -0
  6. data/exe/{format-test → expressir-format-test} +3 -2
  7. data/expressir.gemspec +3 -4
  8. data/lib/expressir/express/cache.rb +6 -6
  9. data/lib/expressir/express/formatter.rb +754 -741
  10. data/lib/expressir/express/hyperlink_formatter.rb +2 -2
  11. data/lib/expressir/express/model_visitor.rb +1 -1
  12. data/lib/expressir/express/parser.rb +224 -100
  13. data/lib/expressir/express/resolve_references_model_visitor.rb +6 -6
  14. data/lib/expressir/express/schema_head_formatter.rb +3 -3
  15. data/lib/expressir/express/visitor.rb +353 -344
  16. data/lib/expressir/liquid/cache_drop.rb +20 -0
  17. data/lib/expressir/liquid/data_type_drop.rb +8 -0
  18. data/lib/expressir/liquid/data_types/aggregate_drop.rb +21 -0
  19. data/lib/expressir/liquid/data_types/array_drop.rb +34 -0
  20. data/lib/expressir/liquid/data_types/bag_drop.rb +26 -0
  21. data/lib/expressir/liquid/data_types/binary_drop.rb +22 -0
  22. data/lib/expressir/liquid/data_types/boolean_drop.rb +10 -0
  23. data/lib/expressir/liquid/data_types/enumeration_drop.rb +30 -0
  24. data/lib/expressir/liquid/data_types/enumeration_item_drop.rb +17 -0
  25. data/lib/expressir/liquid/data_types/generic_drop.rb +17 -0
  26. data/lib/expressir/liquid/data_types/generic_entity_drop.rb +17 -0
  27. data/lib/expressir/liquid/data_types/integer_drop.rb +10 -0
  28. data/lib/expressir/liquid/data_types/list_drop.rb +30 -0
  29. data/lib/expressir/liquid/data_types/logical_drop.rb +10 -0
  30. data/lib/expressir/liquid/data_types/number_drop.rb +10 -0
  31. data/lib/expressir/liquid/data_types/real_drop.rb +18 -0
  32. data/lib/expressir/liquid/data_types/select_drop.rb +34 -0
  33. data/lib/expressir/liquid/data_types/set_drop.rb +26 -0
  34. data/lib/expressir/liquid/data_types/string_drop.rb +22 -0
  35. data/lib/expressir/liquid/declaration_drop.rb +8 -0
  36. data/lib/expressir/liquid/declarations/attribute_drop.rb +37 -0
  37. data/lib/expressir/liquid/declarations/constant_drop.rb +25 -0
  38. data/lib/expressir/liquid/declarations/entity_drop.rb +65 -0
  39. data/lib/expressir/liquid/declarations/function_drop.rb +93 -0
  40. data/lib/expressir/liquid/declarations/interface_drop.rb +30 -0
  41. data/lib/expressir/liquid/declarations/interface_item_drop.rb +22 -0
  42. data/lib/expressir/liquid/declarations/interfaced_item_drop.rb +34 -0
  43. data/lib/expressir/liquid/declarations/parameter_drop.rb +25 -0
  44. data/lib/expressir/liquid/declarations/procedure_drop.rb +89 -0
  45. data/lib/expressir/liquid/declarations/remark_item_drop.rb +22 -0
  46. data/lib/expressir/liquid/declarations/rule_drop.rb +105 -0
  47. data/lib/expressir/liquid/declarations/schema_drop.rb +91 -0
  48. data/lib/expressir/liquid/declarations/schema_version_drop.rb +26 -0
  49. data/lib/expressir/liquid/declarations/schema_version_item_drop.rb +22 -0
  50. data/lib/expressir/liquid/declarations/subtype_constraint_drop.rb +37 -0
  51. data/lib/expressir/liquid/declarations/type_drop.rb +37 -0
  52. data/lib/expressir/liquid/declarations/unique_rule_drop.rb +21 -0
  53. data/lib/expressir/liquid/declarations/variable_drop.rb +25 -0
  54. data/lib/expressir/liquid/declarations/where_rule_drop.rb +21 -0
  55. data/lib/expressir/liquid/expression_drop.rb +8 -0
  56. data/lib/expressir/liquid/expressions/aggregate_initializer_drop.rb +24 -0
  57. data/lib/expressir/liquid/expressions/aggregate_initializer_item_drop.rb +22 -0
  58. data/lib/expressir/liquid/expressions/binary_expression_drop.rb +26 -0
  59. data/lib/expressir/liquid/expressions/entity_constructor_drop.rb +26 -0
  60. data/lib/expressir/liquid/expressions/function_call_drop.rb +26 -0
  61. data/lib/expressir/liquid/expressions/interval_drop.rb +34 -0
  62. data/lib/expressir/liquid/expressions/query_expression_drop.rb +25 -0
  63. data/lib/expressir/liquid/expressions/unary_expression_drop.rb +22 -0
  64. data/lib/expressir/liquid/identifier_drop.rb +33 -0
  65. data/lib/expressir/liquid/literal_drop.rb +8 -0
  66. data/lib/expressir/liquid/literals/binary_drop.rb +18 -0
  67. data/lib/expressir/liquid/literals/integer_drop.rb +18 -0
  68. data/lib/expressir/liquid/literals/logical_drop.rb +18 -0
  69. data/lib/expressir/liquid/literals/real_drop.rb +18 -0
  70. data/lib/expressir/liquid/literals/string_drop.rb +22 -0
  71. data/lib/expressir/liquid/model_element_drop.rb +33 -0
  72. data/lib/expressir/liquid/reference_drop.rb +8 -0
  73. data/lib/expressir/liquid/references/attribute_reference_drop.rb +22 -0
  74. data/lib/expressir/liquid/references/group_reference_drop.rb +22 -0
  75. data/lib/expressir/liquid/references/index_reference_drop.rb +26 -0
  76. data/lib/expressir/liquid/references/simple_reference_drop.rb +22 -0
  77. data/lib/expressir/liquid/repository_drop.rb +22 -0
  78. data/lib/expressir/liquid/statement_drop.rb +8 -0
  79. data/lib/expressir/liquid/statements/alias_drop.rb +29 -0
  80. data/lib/expressir/liquid/statements/assignment_drop.rb +22 -0
  81. data/lib/expressir/liquid/statements/case_action_drop.rb +26 -0
  82. data/lib/expressir/liquid/statements/case_drop.rb +30 -0
  83. data/lib/expressir/liquid/statements/compound_drop.rb +22 -0
  84. data/lib/expressir/liquid/statements/escape_drop.rb +10 -0
  85. data/lib/expressir/liquid/statements/if_drop.rb +34 -0
  86. data/lib/expressir/liquid/statements/null_drop.rb +10 -0
  87. data/lib/expressir/liquid/statements/procedure_call_drop.rb +26 -0
  88. data/lib/expressir/liquid/statements/repeat_drop.rb +45 -0
  89. data/lib/expressir/liquid/statements/return_drop.rb +18 -0
  90. data/lib/expressir/liquid/statements/skip_drop.rb +10 -0
  91. data/lib/expressir/liquid/supertype_expression_drop.rb +8 -0
  92. data/lib/expressir/liquid/supertype_expressions/binary_supertype_expression_drop.rb +26 -0
  93. data/lib/expressir/liquid/supertype_expressions/oneof_supertype_expression_drop.rb +22 -0
  94. data/lib/expressir/liquid.rb +18 -0
  95. data/lib/expressir/model/cache.rb +3 -3
  96. data/lib/expressir/model/data_type.rb +1 -1
  97. data/lib/expressir/model/data_types/aggregate.rb +3 -3
  98. data/lib/expressir/model/data_types/array.rb +6 -6
  99. data/lib/expressir/model/data_types/bag.rb +4 -4
  100. data/lib/expressir/model/data_types/binary.rb +3 -3
  101. data/lib/expressir/model/data_types/boolean.rb +1 -1
  102. data/lib/expressir/model/data_types/enumeration.rb +4 -4
  103. data/lib/expressir/model/data_types/enumeration_item.rb +2 -2
  104. data/lib/expressir/model/data_types/generic.rb +2 -2
  105. data/lib/expressir/model/data_types/generic_entity.rb +2 -2
  106. data/lib/expressir/model/data_types/integer.rb +1 -1
  107. data/lib/expressir/model/data_types/list.rb +5 -5
  108. data/lib/expressir/model/data_types/logical.rb +1 -1
  109. data/lib/expressir/model/data_types/number.rb +1 -1
  110. data/lib/expressir/model/data_types/real.rb +2 -2
  111. data/lib/expressir/model/data_types/select.rb +5 -5
  112. data/lib/expressir/model/data_types/set.rb +4 -4
  113. data/lib/expressir/model/data_types/string.rb +3 -3
  114. data/lib/expressir/model/declaration.rb +1 -1
  115. data/lib/expressir/model/declarations/attribute.rb +7 -7
  116. data/lib/expressir/model/declarations/constant.rb +4 -4
  117. data/lib/expressir/model/declarations/entity.rb +9 -9
  118. data/lib/expressir/model/declarations/function.rb +13 -13
  119. data/lib/expressir/model/declarations/interface.rb +4 -4
  120. data/lib/expressir/model/declarations/interface_item.rb +3 -3
  121. data/lib/expressir/model/declarations/interfaced_item.rb +6 -6
  122. data/lib/expressir/model/declarations/parameter.rb +4 -4
  123. data/lib/expressir/model/declarations/procedure.rb +12 -12
  124. data/lib/expressir/model/declarations/remark_item.rb +3 -3
  125. data/lib/expressir/model/declarations/rule.rb +14 -14
  126. data/lib/expressir/model/declarations/schema.rb +18 -18
  127. data/lib/expressir/model/declarations/schema_version.rb +3 -3
  128. data/lib/expressir/model/declarations/schema_version_item.rb +3 -3
  129. data/lib/expressir/model/declarations/subtype_constraint.rb +6 -6
  130. data/lib/expressir/model/declarations/type.rb +5 -5
  131. data/lib/expressir/model/declarations/unique_rule.rb +3 -3
  132. data/lib/expressir/model/declarations/variable.rb +4 -4
  133. data/lib/expressir/model/declarations/where_rule.rb +3 -3
  134. data/lib/expressir/model/expression.rb +1 -1
  135. data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
  136. data/lib/expressir/model/expressions/aggregate_initializer_item.rb +3 -3
  137. data/lib/expressir/model/expressions/binary_expression.rb +12 -5
  138. data/lib/expressir/model/expressions/entity_constructor.rb +3 -3
  139. data/lib/expressir/model/expressions/function_call.rb +3 -3
  140. data/lib/expressir/model/expressions/interval.rb +6 -6
  141. data/lib/expressir/model/expressions/query_expression.rb +4 -4
  142. data/lib/expressir/model/expressions/unary_expression.rb +3 -3
  143. data/lib/expressir/model/identifier.rb +5 -5
  144. data/lib/expressir/model/literal.rb +1 -1
  145. data/lib/expressir/model/literals/binary.rb +2 -2
  146. data/lib/expressir/model/literals/integer.rb +2 -2
  147. data/lib/expressir/model/literals/logical.rb +2 -2
  148. data/lib/expressir/model/literals/real.rb +2 -2
  149. data/lib/expressir/model/literals/string.rb +3 -3
  150. data/lib/expressir/model/model_element.rb +39 -38
  151. data/lib/expressir/model/reference.rb +1 -1
  152. data/lib/expressir/model/references/attribute_reference.rb +3 -3
  153. data/lib/expressir/model/references/group_reference.rb +3 -3
  154. data/lib/expressir/model/references/index_reference.rb +4 -4
  155. data/lib/expressir/model/references/simple_reference.rb +3 -3
  156. data/lib/expressir/model/repository.rb +3 -4
  157. data/lib/expressir/model/statement.rb +1 -1
  158. data/lib/expressir/model/statements/alias.rb +4 -4
  159. data/lib/expressir/model/statements/assignment.rb +3 -3
  160. data/lib/expressir/model/statements/case.rb +4 -4
  161. data/lib/expressir/model/statements/case_action.rb +3 -3
  162. data/lib/expressir/model/statements/compound.rb +2 -2
  163. data/lib/expressir/model/statements/escape.rb +1 -1
  164. data/lib/expressir/model/statements/if.rb +4 -4
  165. data/lib/expressir/model/statements/null.rb +1 -1
  166. data/lib/expressir/model/statements/procedure_call.rb +3 -3
  167. data/lib/expressir/model/statements/repeat.rb +8 -8
  168. data/lib/expressir/model/statements/return.rb +2 -2
  169. data/lib/expressir/model/statements/skip.rb +1 -1
  170. data/lib/expressir/model/supertype_expression.rb +1 -1
  171. data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +4 -4
  172. data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +2 -2
  173. data/lib/expressir/version.rb +1 -1
  174. data/lib/expressir.rb +2 -0
  175. metadata +103 -13
  176. /data/exe/{format → expressir-format} +0 -0
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class InterfacedItemDrop < ::Expressir::Liquid::ModelElementDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def id
13
+ @model.id
14
+ end
15
+
16
+ def remarks
17
+ @model.remarks || []
18
+ end
19
+
20
+ def remark_items
21
+ return [] unless @model.remark_items
22
+
23
+ @model.remark_items.map do |item|
24
+ ::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
25
+ end
26
+ end
27
+
28
+ def base_item
29
+ ::Expressir::Liquid::ModelElementDrop.new(@model.base_item)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class ParameterDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def var
16
+ @model.var
17
+ end
18
+
19
+ def type
20
+ drop_klass_by_model(@model.type)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class ProcedureDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def parameters
16
+ return [] unless @model.parameters
17
+
18
+ @model.parameters.map do |item|
19
+ ::Expressir::Liquid::Declarations::ParameterDrop.new(item)
20
+ end
21
+ end
22
+
23
+ def types
24
+ return [] unless @model.types
25
+
26
+ @model.types.map do |item|
27
+ ::Expressir::Liquid::Declarations::TypeDrop.new(item)
28
+ end
29
+ end
30
+
31
+ def entities
32
+ return [] unless @model.entities
33
+
34
+ @model.entities.map do |item|
35
+ ::Expressir::Liquid::Declarations::EntityDrop.new(item)
36
+ end
37
+ end
38
+
39
+ def subtype_constraints
40
+ return [] unless @model.subtype_constraints
41
+
42
+ @model.subtype_constraints.map do |item|
43
+ ::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
44
+ end
45
+ end
46
+
47
+ def functions
48
+ return [] unless @model.functions
49
+
50
+ @model.functions.map do |item|
51
+ ::Expressir::Liquid::Declarations::FunctionDrop.new(item)
52
+ end
53
+ end
54
+
55
+ def procedures
56
+ return [] unless @model.procedures
57
+
58
+ @model.procedures.map do |item|
59
+ ::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
60
+ end
61
+ end
62
+
63
+ def constants
64
+ return [] unless @model.constants
65
+
66
+ @model.constants.map do |item|
67
+ ::Expressir::Liquid::Declarations::ConstantDrop.new(item)
68
+ end
69
+ end
70
+
71
+ def variables
72
+ return [] unless @model.variables
73
+
74
+ @model.variables.map do |item|
75
+ ::Expressir::Liquid::Declarations::VariableDrop.new(item)
76
+ end
77
+ end
78
+
79
+ def statements
80
+ return [] unless @model.statements
81
+
82
+ @model.statements.map do |item|
83
+ ::Expressir::Liquid::StatementDrop.new(item)
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class RemarkItemDrop < ::Expressir::Liquid::DeclarationDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def id
13
+ @model.id
14
+ end
15
+
16
+ def remarks
17
+ @model.remarks || []
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class RuleDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def applies_to
16
+ return [] unless @model.applies_to
17
+
18
+ @model.applies_to.map do |item|
19
+ drop_klass_by_model(item)
20
+ end
21
+ end
22
+
23
+ def types
24
+ return [] unless @model.types
25
+
26
+ @model.types.map do |item|
27
+ ::Expressir::Liquid::Declarations::TypeDrop.new(item)
28
+ end
29
+ end
30
+
31
+ def entities
32
+ return [] unless @model.entities
33
+
34
+ @model.entities.map do |item|
35
+ ::Expressir::Liquid::Declarations::EntityDrop.new(item)
36
+ end
37
+ end
38
+
39
+ def subtype_constraints
40
+ return [] unless @model.subtype_constraints
41
+
42
+ @model.subtype_constraints.map do |item|
43
+ ::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
44
+ end
45
+ end
46
+
47
+ def functions
48
+ return [] unless @model.functions
49
+
50
+ @model.functions.map do |item|
51
+ ::Expressir::Liquid::Declarations::FunctionDrop.new(item)
52
+ end
53
+ end
54
+
55
+ def procedures
56
+ return [] unless @model.procedures
57
+
58
+ @model.procedures.map do |item|
59
+ ::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
60
+ end
61
+ end
62
+
63
+ def constants
64
+ return [] unless @model.constants
65
+
66
+ @model.constants.map do |item|
67
+ ::Expressir::Liquid::Declarations::ConstantDrop.new(item)
68
+ end
69
+ end
70
+
71
+ def variables
72
+ return [] unless @model.variables
73
+
74
+ @model.variables.map do |item|
75
+ ::Expressir::Liquid::Declarations::VariableDrop.new(item)
76
+ end
77
+ end
78
+
79
+ def statements
80
+ return [] unless @model.statements
81
+
82
+ @model.statements.map do |item|
83
+ ::Expressir::Liquid::StatementDrop.new(item)
84
+ end
85
+ end
86
+
87
+ def where_rules
88
+ return [] unless @model.where_rules
89
+
90
+ @model.where_rules.map do |item|
91
+ ::Expressir::Liquid::Declarations::WhereRuleDrop.new(item)
92
+ end
93
+ end
94
+
95
+ def informal_propositions
96
+ return [] unless @model.informal_propositions
97
+
98
+ @model.informal_propositions.map do |item|
99
+ ::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class SchemaDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def file
16
+ @model.file
17
+ end
18
+
19
+ def version
20
+ ::Expressir::Liquid::Declarations::SchemaVersionDrop.new(
21
+ @model.version,
22
+ )
23
+ end
24
+
25
+ def interfaces
26
+ return [] unless @model.interfaces
27
+
28
+ @model.interfaces.map do |item|
29
+ ::Expressir::Liquid::Declarations::InterfaceDrop.new(item)
30
+ end
31
+ end
32
+
33
+ def constants
34
+ return [] unless @model.constants
35
+
36
+ @model.constants.map do |item|
37
+ ::Expressir::Liquid::Declarations::ConstantDrop.new(item)
38
+ end
39
+ end
40
+
41
+ def types
42
+ return [] unless @model.types
43
+
44
+ @model.types.map do |item|
45
+ ::Expressir::Liquid::Declarations::TypeDrop.new(item)
46
+ end
47
+ end
48
+
49
+ def entities
50
+ return [] unless @model.entities
51
+
52
+ @model.entities.map do |item|
53
+ ::Expressir::Liquid::Declarations::EntityDrop.new(item)
54
+ end
55
+ end
56
+
57
+ def subtype_constraints
58
+ return [] unless @model.subtype_constraints
59
+
60
+ @model.subtype_constraints.map do |item|
61
+ ::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
62
+ end
63
+ end
64
+
65
+ def functions
66
+ return [] unless @model.functions
67
+
68
+ @model.functions.map do |item|
69
+ ::Expressir::Liquid::Declarations::FunctionDrop.new(item)
70
+ end
71
+ end
72
+
73
+ def rules
74
+ return [] unless @model.rules
75
+
76
+ @model.rules.map do |item|
77
+ ::Expressir::Liquid::Declarations::RuleDrop.new(item)
78
+ end
79
+ end
80
+
81
+ def procedures
82
+ return [] unless @model.procedures
83
+
84
+ @model.procedures.map do |item|
85
+ ::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class SchemaVersionDrop < ::Expressir::Liquid::ModelElementDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def value
13
+ @model.value
14
+ end
15
+
16
+ def items
17
+ return [] unless @model.items
18
+
19
+ @model.items.map do |item|
20
+ ::Expressir::Liquid::Declarations::SchemaVersionItemDrop.new(item)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class SchemaVersionItemDrop < ::Expressir::Liquid::ModelElementDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def name
13
+ @model.name
14
+ end
15
+
16
+ def value
17
+ @model.value
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class SubtypeConstraintDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def applies_to
16
+ drop_klass_by_model(@model.applies_to)
17
+ end
18
+
19
+ def abstract
20
+ @model.abstract
21
+ end
22
+
23
+ def total_over
24
+ return [] unless @model.total_over
25
+
26
+ @model.total_over.map do |item|
27
+ drop_klass_by_model(item)
28
+ end
29
+ end
30
+
31
+ def supertype_expression
32
+ drop_klass_by_model(@model.supertype_expression)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class TypeDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def underlying_type
16
+ drop_klass_by_model(@model.underlying_type)
17
+ end
18
+
19
+ def where_rules
20
+ return [] unless @model.where_rules
21
+
22
+ @model.where_rules.map do |item|
23
+ ::Expressir::Liquid::Declarations::WhereRuleDrop.new(item)
24
+ end
25
+ end
26
+
27
+ def informal_propositions
28
+ return [] unless @model.informal_propositions
29
+
30
+ @model.informal_propositions.map do |item|
31
+ ::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class UniqueRuleDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def attributes
16
+ drop_klass_by_model(@model.attributes)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class VariableDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def type
16
+ drop_klass_by_model(@model.type)
17
+ end
18
+
19
+ def expression
20
+ drop_klass_by_model(@model.expression)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Declarations
6
+ class WhereRuleDrop < ::Expressir::Liquid::DeclarationDrop
7
+ include ::Expressir::Liquid::IdentifierDrop
8
+
9
+ def initialize(model)
10
+ @model = model
11
+ initialize_identifier(@model)
12
+ super
13
+ end
14
+
15
+ def expression
16
+ drop_klass_by_model(@model.expression)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ class ExpressionDrop < ::Expressir::Liquid::ModelElementDrop
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Expressions
6
+ class AggregateInitializerDrop < ::Expressir::Liquid::ExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def items
13
+ return [] unless @model.items
14
+
15
+ @model.items.map do |item|
16
+ ::Expressir::Liquid::Expressions::AggregateInitializerItemDrop.new(
17
+ item,
18
+ )
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Expressions
6
+ class AggregateInitializerItemDrop < ::Expressir::Liquid::ExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def expression
13
+ drop_klass_by_model(@model.expression)
14
+ end
15
+
16
+ def repetition
17
+ drop_klass_by_model(@model.repetition)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Expressions
6
+ class BinaryExpressionDrop < ::Expressir::Liquid::ExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def operator
13
+ @model.operator
14
+ end
15
+
16
+ def operand1
17
+ drop_klass_by_model(@model.operand1)
18
+ end
19
+
20
+ def operand2
21
+ drop_klass_by_model(@model.operand2)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Expressions
6
+ class EntityConstructorDrop < ::Expressir::Liquid::ExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def entity
13
+ drop_klass_by_model(@model.entity)
14
+ end
15
+
16
+ def parameters
17
+ return [] unless @model.parameters
18
+
19
+ @model.parameters.map do |item|
20
+ drop_klass_by_model(item)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Liquid
5
+ module Expressions
6
+ class FunctionCallDrop < ::Expressir::Liquid::ExpressionDrop
7
+ def initialize(model)
8
+ @model = model
9
+ super
10
+ end
11
+
12
+ def function
13
+ drop_klass_by_model(@model.function)
14
+ end
15
+
16
+ def parameters
17
+ return [] unless @model.parameters
18
+
19
+ @model.parameters.map do |item|
20
+ drop_klass_by_model(item)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end