expressir 2.0.0 → 2.1.1

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 (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
@@ -1,12 +1,12 @@
1
- require 'pathname'
1
+ require "pathname"
2
2
 
3
3
  module Expressir
4
4
  module Model
5
5
  # Base model element
6
6
  class ModelElement
7
- CLASS_KEY = '_class'
8
- FILE_KEY = 'file'
9
- SOURCE_KEY = 'source'
7
+ CLASS_KEY = "_class".freeze
8
+ FILE_KEY = "file".freeze
9
+ SOURCE_KEY = "source".freeze
10
10
 
11
11
  private_constant :CLASS_KEY
12
12
  private_constant :FILE_KEY
@@ -16,19 +16,19 @@ module Expressir
16
16
  attr_accessor :parent
17
17
 
18
18
  # @param [Hash] options
19
- def initialize(options = {})
19
+ def initialize(_options = {})
20
20
  attach_parent_to_children
21
21
  end
22
22
 
23
23
  # @return [String]
24
24
  def path
25
25
  # this creates an implicit scope
26
- return if is_a? Statements::Alias or is_a? Statements::Repeat or is_a? Expressions::QueryExpression
26
+ return if is_a?(Statements::Alias) || is_a?(Statements::Repeat) || is_a?(Expressions::QueryExpression)
27
27
 
28
28
  current_node = self
29
29
  path_parts = []
30
30
  loop do
31
- if current_node.class.method_defined? :id and !(current_node.is_a? References::SimpleReference)
31
+ if current_node.class.method_defined?(:id) && !(current_node.is_a? References::SimpleReference)
32
32
  path_parts << current_node.id
33
33
  end
34
34
 
@@ -82,7 +82,7 @@ module Expressir
82
82
 
83
83
  # @return [Hash<String, Declaration>]
84
84
  def children_by_id
85
- @children_by_id ||= children.select{|x| x.id}.map{|x| [x.id.safe_downcase, x]}.to_h
85
+ @children_by_id ||= children.select(&:id).map { |x| [x.id.safe_downcase, x] }.to_h
86
86
  end
87
87
 
88
88
  # @return [nil]
@@ -105,11 +105,11 @@ module Expressir
105
105
  hash[CLASS_KEY] = self.class.name
106
106
 
107
107
  self.class.model_attrs.each do |variable|
108
- value = self.send(variable)
109
- empty = value.nil? || (value.is_a?(Array) && value.count == 0)
108
+ value = send(variable)
109
+ empty = value.nil? || (value.is_a?(Array) && value.count.zero?)
110
110
 
111
111
  # skip empty values
112
- next unless !empty or include_empty
112
+ next unless !empty || include_empty
113
113
 
114
114
  value_hash = case value
115
115
  when Array
@@ -119,7 +119,7 @@ module Expressir
119
119
  root_path: root_path,
120
120
  formatter: formatter,
121
121
  include_empty: include_empty,
122
- select_proc: select_proc
122
+ select_proc: select_proc,
123
123
  )
124
124
  else
125
125
  v
@@ -130,7 +130,7 @@ module Expressir
130
130
  root_path: root_path,
131
131
  formatter: formatter,
132
132
  include_empty: include_empty,
133
- select_proc: select_proc
133
+ select_proc: select_proc,
134
134
  )
135
135
  else
136
136
  value
@@ -139,25 +139,28 @@ module Expressir
139
139
  hash[variable.to_s] = value_hash unless value_hash.nil?
140
140
  end
141
141
 
142
- if self.is_a? Declarations::Schema and file
142
+ if is_a?(Declarations::Schema) && file
143
143
  hash[FILE_KEY] = root_path ? Pathname.new(file).relative_path_from(root_path).to_s : file
144
144
  end
145
145
 
146
- if self.class.method_defined? :source and formatter
146
+ if self.class.method_defined?(:source) && formatter
147
147
  hash[SOURCE_KEY] = formatter.format(self)
148
148
  end
149
149
 
150
150
  hash
151
151
  end
152
152
 
153
- def to_s
154
- to_s(no_remarks: false, formatter: nil)
153
+ # @return [Liquid::Drop]
154
+ def to_liquid
155
+ klass_name = "#{self.class.name.gsub('::Model::', '::Liquid::')}Drop"
156
+ klass = Object.const_get(klass_name)
157
+ klass.new(self)
155
158
  end
156
159
 
157
160
  def to_s(no_remarks: false, formatter: nil)
158
161
  formatter ||= Class.new(Expressir::Express::Formatter) do
159
162
  if no_remarks
160
- def format_remarks(node); []; end
163
+ def format_remarks(_node); []; end
161
164
  end
162
165
  end
163
166
  formatter.format(self)
@@ -174,28 +177,26 @@ module Expressir
174
177
  value = hash[variable.to_s]
175
178
 
176
179
  node_options[variable] = case value
177
- when Array
178
- value.map do |value|
179
- if value.is_a? Hash
180
- self.from_hash(value, root_path: root_path)
181
- else
182
- value
183
- end
184
- end
185
- when Hash
186
- self.from_hash(value, root_path: root_path)
187
- else
188
- value
189
- end
180
+ when Array
181
+ value.map do |value|
182
+ if value.is_a? Hash
183
+ from_hash(value, root_path: root_path)
184
+ else
185
+ value
186
+ end
187
+ end
188
+ when Hash
189
+ from_hash(value, root_path: root_path)
190
+ else
191
+ value
192
+ end
190
193
  end
191
194
 
192
- if node_class == Declarations::Schema and hash[FILE_KEY]
195
+ if (node_class == Declarations::Schema) && hash[FILE_KEY]
193
196
  node_options[FILE_KEY.to_sym] = root_path ? File.expand_path("#{root_path}/#{hash[FILE_KEY]}") : hash[FILE_KEY]
194
197
  end
195
198
 
196
- node = node_class.new(node_options)
197
-
198
- node
199
+ node_class.new(node_options)
199
200
  end
200
201
 
201
202
  # @return [Array<Symbol>]
@@ -209,7 +210,7 @@ module Expressir
209
210
  # @!macro [attach] model_attr_accessor
210
211
  # @!attribute $1
211
212
  # @return [$2]
212
- def self.model_attr_accessor(attr_name, attr_type = nil)
213
+ def self.model_attr_accessor(attr_name, _attr_type = nil)
213
214
  @model_attrs ||= []
214
215
  @model_attrs << attr_name
215
216
 
@@ -221,7 +222,7 @@ module Expressir
221
222
  # @return [nil]
222
223
  def attach_parent_to_children
223
224
  self.class.model_attrs.each do |variable|
224
- value = self.send(variable)
225
+ value = send(variable)
225
226
 
226
227
  case value
227
228
  when Array
@@ -238,4 +239,4 @@ module Expressir
238
239
  end
239
240
  end
240
241
  end
241
- end
242
+ end
@@ -6,4 +6,4 @@ module Expressir
6
6
  class Reference < ModelElement
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 12.7.3 Attribute references
6
6
  class AttributeReference < Reference
7
- model_attr_accessor :ref, 'Reference'
8
- model_attr_accessor :attribute, 'Reference'
7
+ model_attr_accessor :ref, "Reference"
8
+ model_attr_accessor :attribute, "Reference"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Reference] :ref
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 12.7.4 Group references
6
6
  class GroupReference < Reference
7
- model_attr_accessor :ref, 'Reference'
8
- model_attr_accessor :entity, 'Reference'
7
+ model_attr_accessor :ref, "Reference"
8
+ model_attr_accessor :entity, "Reference"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Reference] :ref
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -6,9 +6,9 @@ module Expressir
6
6
  # - section 12.5.1 String indexing
7
7
  # - section 12.6.1 Aggregate indexing
8
8
  class IndexReference < Reference
9
- model_attr_accessor :ref, 'Reference'
10
- model_attr_accessor :index1, 'Expression'
11
- model_attr_accessor :index2, 'Expression'
9
+ model_attr_accessor :ref, "Reference"
10
+ model_attr_accessor :index1, "Expression"
11
+ model_attr_accessor :index2, "Expression"
12
12
 
13
13
  # @param [Hash] options
14
14
  # @option options [Reference] :ref
@@ -24,4 +24,4 @@ module Expressir
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -4,9 +4,9 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 12.7.1 Simple references
6
6
  class SimpleReference < Reference
7
- model_attr_accessor :id, 'String'
7
+ model_attr_accessor :id, "String"
8
8
 
9
- model_attr_accessor :base_path, 'String'
9
+ model_attr_accessor :base_path, "String"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option options [String] :id
@@ -21,4 +21,4 @@ module Expressir
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -2,7 +2,7 @@ module Expressir
2
2
  module Model
3
3
  # Multi-schema global scope
4
4
  class Repository < ModelElement
5
- model_attr_accessor :schemas, 'Array<Declarations::Schema>'
5
+ model_attr_accessor :schemas, "Array<Declarations::Schema>"
6
6
 
7
7
  # @param [Hash] options
8
8
  # @option options [Array<Declarations::Schema>] :schemas
@@ -15,10 +15,9 @@ module Expressir
15
15
  # @return [Array<Declaration>]
16
16
  def children
17
17
  [
18
- *schemas
18
+ *schemas,
19
19
  ]
20
20
  end
21
-
22
21
  end
23
22
  end
24
- end
23
+ end
@@ -6,4 +6,4 @@ module Expressir
6
6
  class Statement < ModelElement
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -6,8 +6,8 @@ module Expressir
6
6
  class Alias < Statement
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :expression, 'Expression'
10
- model_attr_accessor :statements, 'Array<Statement>'
9
+ model_attr_accessor :expression, "Expression"
10
+ model_attr_accessor :statements, "Array<Statement>"
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option (see Identifier#initialize_identifier)
@@ -26,10 +26,10 @@ module Expressir
26
26
  def children
27
27
  [
28
28
  self,
29
- *remark_items
29
+ *remark_items,
30
30
  ]
31
31
  end
32
32
  end
33
33
  end
34
34
  end
35
- end
35
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.3 Assignment
6
6
  class Assignment < Statement
7
- model_attr_accessor :ref, 'Reference'
8
- model_attr_accessor :expression, 'Expression'
7
+ model_attr_accessor :ref, "Reference"
8
+ model_attr_accessor :expression, "Expression"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Reference] :ref
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -4,9 +4,9 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.4 Case statement
6
6
  class Case < Statement
7
- model_attr_accessor :expression, 'Expression'
8
- model_attr_accessor :actions, 'Array<CaseAction>'
9
- model_attr_accessor :otherwise_statement, 'Statement'
7
+ model_attr_accessor :expression, "Expression"
8
+ model_attr_accessor :actions, "Array<CaseAction>"
9
+ model_attr_accessor :otherwise_statement, "Statement"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option options [Expression] :expression
@@ -22,4 +22,4 @@ module Expressir
22
22
  end
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.4 Case statement
6
6
  class CaseAction < ModelElement
7
- model_attr_accessor :labels, 'Array<Expression>'
8
- model_attr_accessor :statement, 'Statement'
7
+ model_attr_accessor :labels, "Array<Expression>"
8
+ model_attr_accessor :statement, "Statement"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Array<Expression>] :labels
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -4,7 +4,7 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.5 Compound statement
6
6
  class Compound < Statement
7
- model_attr_accessor :statements, 'Array<Statement>'
7
+ model_attr_accessor :statements, "Array<Statement>"
8
8
 
9
9
  # @param [Hash] options
10
10
  # @option options [Array<Statement>] :statements
@@ -16,4 +16,4 @@ module Expressir
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -4,9 +4,9 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.7 If ... Then ... Else statement
6
6
  class If < Statement
7
- model_attr_accessor :expression, 'Expression'
8
- model_attr_accessor :statements, 'Array<Statement>'
9
- model_attr_accessor :else_statements, 'Array<Statement>'
7
+ model_attr_accessor :expression, "Expression"
8
+ model_attr_accessor :statements, "Array<Statement>"
9
+ model_attr_accessor :else_statements, "Array<Statement>"
10
10
 
11
11
  # @param [Hash] options
12
12
  # @option options [Expression] :expression
@@ -22,4 +22,4 @@ module Expressir
22
22
  end
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -4,8 +4,8 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.8 Procedure call statement
6
6
  class ProcedureCall < Statement
7
- model_attr_accessor :procedure, 'Reference'
8
- model_attr_accessor :parameters, 'Array<Expression>'
7
+ model_attr_accessor :procedure, "Reference"
8
+ model_attr_accessor :parameters, "Array<Expression>"
9
9
 
10
10
  # @param [Hash] options
11
11
  # @option options [Reference] :procedure
@@ -19,4 +19,4 @@ module Expressir
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -6,12 +6,12 @@ module Expressir
6
6
  class Repeat < Statement
7
7
  include Identifier
8
8
 
9
- model_attr_accessor :bound1, 'Expression'
10
- model_attr_accessor :bound2, 'Expression'
11
- model_attr_accessor :increment, 'Expression'
12
- model_attr_accessor :while_expression, 'Expression'
13
- model_attr_accessor :until_expression, 'Expression'
14
- model_attr_accessor :statements, 'Array<Statement>'
9
+ model_attr_accessor :bound1, "Expression"
10
+ model_attr_accessor :bound2, "Expression"
11
+ model_attr_accessor :increment, "Expression"
12
+ model_attr_accessor :while_expression, "Expression"
13
+ model_attr_accessor :until_expression, "Expression"
14
+ model_attr_accessor :statements, "Array<Statement>"
15
15
 
16
16
  # @param [Hash] options
17
17
  # @option (see Identifier#initialize_identifier)
@@ -38,10 +38,10 @@ module Expressir
38
38
  def children
39
39
  [
40
40
  self,
41
- *remark_items
41
+ *remark_items,
42
42
  ]
43
43
  end
44
44
  end
45
45
  end
46
46
  end
47
- end
47
+ end
@@ -4,7 +4,7 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 13.10 Return statement
6
6
  class Return < Statement
7
- model_attr_accessor :expression, 'Expression'
7
+ model_attr_accessor :expression, "Expression"
8
8
 
9
9
  # @param [Hash] options
10
10
  # @option options [Expression] :expression
@@ -16,4 +16,4 @@ module Expressir
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -7,4 +7,4 @@ module Expressir
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -6,4 +6,4 @@ module Expressir
6
6
  class SupertypeExpression < ModelElement
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -8,9 +8,9 @@ module Expressir
8
8
  AND = :AND
9
9
  ANDOR = :ANDOR
10
10
 
11
- model_attr_accessor :operator, ':AND, :ANDOR'
12
- model_attr_accessor :operand1, 'SupertypeExpression'
13
- model_attr_accessor :operand2, 'SupertypeExpression'
11
+ model_attr_accessor :operator, ":AND, :ANDOR"
12
+ model_attr_accessor :operand1, "SupertypeExpression"
13
+ model_attr_accessor :operand2, "SupertypeExpression"
14
14
 
15
15
  # @param [Hash] options
16
16
  # @option options [:AND, :ANDOR] :operator
@@ -26,4 +26,4 @@ module Expressir
26
26
  end
27
27
  end
28
28
  end
29
- end
29
+ end
@@ -4,7 +4,7 @@ module Expressir
4
4
  # Specified in ISO 10303-11:2004
5
5
  # - section 9.2.5.2 ONEOF
6
6
  class OneofSupertypeExpression < SupertypeExpression
7
- model_attr_accessor :operands, 'Array<SupertypeExpression>'
7
+ model_attr_accessor :operands, "Array<SupertypeExpression>"
8
8
 
9
9
  # @param [Hash] options
10
10
  # @option options [Array<SupertypeExpression>] :operands
@@ -16,4 +16,4 @@ module Expressir
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "2.0.0".freeze
2
+ VERSION = "2.1.1".freeze
3
3
  end
data/lib/expressir.rb CHANGED
@@ -38,3 +38,5 @@ end
38
38
  Dir[File.join(__dir__, "expressir", "express", "*.rb")].sort.each do |fea|
39
39
  require fea
40
40
  end
41
+
42
+ require "expressir/liquid"