expressir 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -13
- data/.rubocop_todo.yml +69 -6
- data/Gemfile +1 -1
- data/README.adoc +46 -0
- data/exe/expressir-format-test +2 -1
- data/expressir.gemspec +2 -3
- data/lib/expressir/express/cache.rb +6 -6
- data/lib/expressir/express/formatter.rb +754 -741
- data/lib/expressir/express/hyperlink_formatter.rb +2 -2
- data/lib/expressir/express/model_visitor.rb +1 -1
- data/lib/expressir/express/parser.rb +224 -100
- data/lib/expressir/express/resolve_references_model_visitor.rb +6 -6
- data/lib/expressir/express/schema_head_formatter.rb +3 -3
- data/lib/expressir/express/visitor.rb +353 -344
- data/lib/expressir/model/cache.rb +3 -3
- data/lib/expressir/model/data_type.rb +1 -1
- data/lib/expressir/model/data_types/aggregate.rb +3 -3
- data/lib/expressir/model/data_types/array.rb +6 -6
- data/lib/expressir/model/data_types/bag.rb +4 -4
- data/lib/expressir/model/data_types/binary.rb +3 -3
- data/lib/expressir/model/data_types/boolean.rb +1 -1
- data/lib/expressir/model/data_types/enumeration.rb +4 -4
- data/lib/expressir/model/data_types/enumeration_item.rb +2 -2
- data/lib/expressir/model/data_types/generic.rb +2 -2
- data/lib/expressir/model/data_types/generic_entity.rb +2 -2
- data/lib/expressir/model/data_types/integer.rb +1 -1
- data/lib/expressir/model/data_types/list.rb +5 -5
- data/lib/expressir/model/data_types/logical.rb +1 -1
- data/lib/expressir/model/data_types/number.rb +1 -1
- data/lib/expressir/model/data_types/real.rb +2 -2
- data/lib/expressir/model/data_types/select.rb +5 -5
- data/lib/expressir/model/data_types/set.rb +4 -4
- data/lib/expressir/model/data_types/string.rb +3 -3
- data/lib/expressir/model/declaration.rb +1 -1
- data/lib/expressir/model/declarations/attribute.rb +7 -7
- data/lib/expressir/model/declarations/constant.rb +4 -4
- data/lib/expressir/model/declarations/entity.rb +9 -9
- data/lib/expressir/model/declarations/function.rb +13 -13
- data/lib/expressir/model/declarations/interface.rb +4 -4
- data/lib/expressir/model/declarations/interface_item.rb +3 -3
- data/lib/expressir/model/declarations/interfaced_item.rb +6 -6
- data/lib/expressir/model/declarations/parameter.rb +4 -4
- data/lib/expressir/model/declarations/procedure.rb +12 -12
- data/lib/expressir/model/declarations/remark_item.rb +3 -3
- data/lib/expressir/model/declarations/rule.rb +14 -14
- data/lib/expressir/model/declarations/schema.rb +18 -18
- data/lib/expressir/model/declarations/schema_version.rb +3 -3
- data/lib/expressir/model/declarations/schema_version_item.rb +3 -3
- data/lib/expressir/model/declarations/subtype_constraint.rb +6 -6
- data/lib/expressir/model/declarations/type.rb +5 -5
- data/lib/expressir/model/declarations/unique_rule.rb +3 -3
- data/lib/expressir/model/declarations/variable.rb +4 -4
- data/lib/expressir/model/declarations/where_rule.rb +3 -3
- data/lib/expressir/model/expression.rb +1 -1
- data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
- data/lib/expressir/model/expressions/aggregate_initializer_item.rb +3 -3
- data/lib/expressir/model/expressions/binary_expression.rb +12 -5
- data/lib/expressir/model/expressions/entity_constructor.rb +3 -3
- data/lib/expressir/model/expressions/function_call.rb +3 -3
- data/lib/expressir/model/expressions/interval.rb +6 -6
- data/lib/expressir/model/expressions/query_expression.rb +4 -4
- data/lib/expressir/model/expressions/unary_expression.rb +3 -3
- data/lib/expressir/model/identifier.rb +5 -5
- data/lib/expressir/model/literal.rb +1 -1
- data/lib/expressir/model/literals/binary.rb +2 -2
- data/lib/expressir/model/literals/integer.rb +2 -2
- data/lib/expressir/model/literals/logical.rb +2 -2
- data/lib/expressir/model/literals/real.rb +2 -2
- data/lib/expressir/model/literals/string.rb +3 -3
- data/lib/expressir/model/model_element.rb +35 -41
- data/lib/expressir/model/reference.rb +1 -1
- data/lib/expressir/model/references/attribute_reference.rb +3 -3
- data/lib/expressir/model/references/group_reference.rb +3 -3
- data/lib/expressir/model/references/index_reference.rb +4 -4
- data/lib/expressir/model/references/simple_reference.rb +3 -3
- data/lib/expressir/model/repository.rb +3 -4
- data/lib/expressir/model/statement.rb +1 -1
- data/lib/expressir/model/statements/alias.rb +4 -4
- data/lib/expressir/model/statements/assignment.rb +3 -3
- data/lib/expressir/model/statements/case.rb +4 -4
- data/lib/expressir/model/statements/case_action.rb +3 -3
- data/lib/expressir/model/statements/compound.rb +2 -2
- data/lib/expressir/model/statements/escape.rb +1 -1
- data/lib/expressir/model/statements/if.rb +4 -4
- data/lib/expressir/model/statements/null.rb +1 -1
- data/lib/expressir/model/statements/procedure_call.rb +3 -3
- data/lib/expressir/model/statements/repeat.rb +8 -8
- data/lib/expressir/model/statements/return.rb +2 -2
- data/lib/expressir/model/statements/skip.rb +1 -1
- data/lib/expressir/model/supertype_expression.rb +1 -1
- data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +4 -4
- data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +2 -2
- data/lib/expressir/version.rb +1 -1
- metadata +12 -12
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
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 =
|
8
|
-
FILE_KEY =
|
9
|
-
SOURCE_KEY =
|
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(
|
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?
|
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?
|
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
|
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 =
|
109
|
-
empty = value.nil? || (value.is_a?(Array) && value.count
|
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
|
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,11 +139,11 @@ module Expressir
|
|
139
139
|
hash[variable.to_s] = value_hash unless value_hash.nil?
|
140
140
|
end
|
141
141
|
|
142
|
-
if
|
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?
|
146
|
+
if self.class.method_defined?(:source) && formatter
|
147
147
|
hash[SOURCE_KEY] = formatter.format(self)
|
148
148
|
end
|
149
149
|
|
@@ -152,19 +152,15 @@ module Expressir
|
|
152
152
|
|
153
153
|
# @return [Liquid::Drop]
|
154
154
|
def to_liquid
|
155
|
-
klass_name = self.class.name.gsub(
|
155
|
+
klass_name = "#{self.class.name.gsub('::Model::', '::Liquid::')}Drop"
|
156
156
|
klass = Object.const_get(klass_name)
|
157
157
|
klass.new(self)
|
158
158
|
end
|
159
159
|
|
160
|
-
def to_s
|
161
|
-
to_s(no_remarks: false, formatter: nil)
|
162
|
-
end
|
163
|
-
|
164
160
|
def to_s(no_remarks: false, formatter: nil)
|
165
161
|
formatter ||= Class.new(Expressir::Express::Formatter) do
|
166
162
|
if no_remarks
|
167
|
-
def format_remarks(
|
163
|
+
def format_remarks(_node); []; end
|
168
164
|
end
|
169
165
|
end
|
170
166
|
formatter.format(self)
|
@@ -181,28 +177,26 @@ module Expressir
|
|
181
177
|
value = hash[variable.to_s]
|
182
178
|
|
183
179
|
node_options[variable] = case value
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
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
|
197
193
|
end
|
198
194
|
|
199
|
-
if node_class == Declarations::Schema
|
195
|
+
if (node_class == Declarations::Schema) && hash[FILE_KEY]
|
200
196
|
node_options[FILE_KEY.to_sym] = root_path ? File.expand_path("#{root_path}/#{hash[FILE_KEY]}") : hash[FILE_KEY]
|
201
197
|
end
|
202
198
|
|
203
|
-
|
204
|
-
|
205
|
-
node
|
199
|
+
node_class.new(node_options)
|
206
200
|
end
|
207
201
|
|
208
202
|
# @return [Array<Symbol>]
|
@@ -216,7 +210,7 @@ module Expressir
|
|
216
210
|
# @!macro [attach] model_attr_accessor
|
217
211
|
# @!attribute $1
|
218
212
|
# @return [$2]
|
219
|
-
def self.model_attr_accessor(attr_name,
|
213
|
+
def self.model_attr_accessor(attr_name, _attr_type = nil)
|
220
214
|
@model_attrs ||= []
|
221
215
|
@model_attrs << attr_name
|
222
216
|
|
@@ -228,7 +222,7 @@ module Expressir
|
|
228
222
|
# @return [nil]
|
229
223
|
def attach_parent_to_children
|
230
224
|
self.class.model_attrs.each do |variable|
|
231
|
-
value =
|
225
|
+
value = send(variable)
|
232
226
|
|
233
227
|
case value
|
234
228
|
when Array
|
@@ -245,4 +239,4 @@ module Expressir
|
|
245
239
|
end
|
246
240
|
end
|
247
241
|
end
|
248
|
-
end
|
242
|
+
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,
|
8
|
-
model_attr_accessor :attribute,
|
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,
|
8
|
-
model_attr_accessor :entity,
|
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,
|
10
|
-
model_attr_accessor :index1,
|
11
|
-
model_attr_accessor :index2,
|
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,
|
7
|
+
model_attr_accessor :id, "String"
|
8
8
|
|
9
|
-
model_attr_accessor :base_path,
|
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,
|
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,8 +6,8 @@ module Expressir
|
|
6
6
|
class Alias < Statement
|
7
7
|
include Identifier
|
8
8
|
|
9
|
-
model_attr_accessor :expression,
|
10
|
-
model_attr_accessor :statements,
|
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,
|
8
|
-
model_attr_accessor :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,
|
8
|
-
model_attr_accessor :actions,
|
9
|
-
model_attr_accessor :otherwise_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,
|
8
|
-
model_attr_accessor :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,
|
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
|
@@ -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,
|
8
|
-
model_attr_accessor :statements,
|
9
|
-
model_attr_accessor :else_statements,
|
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
|
@@ -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,
|
8
|
-
model_attr_accessor :parameters,
|
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,
|
10
|
-
model_attr_accessor :bound2,
|
11
|
-
model_attr_accessor :increment,
|
12
|
-
model_attr_accessor :while_expression,
|
13
|
-
model_attr_accessor :until_expression,
|
14
|
-
model_attr_accessor :statements,
|
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,
|
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
|
@@ -8,9 +8,9 @@ module Expressir
|
|
8
8
|
AND = :AND
|
9
9
|
ANDOR = :ANDOR
|
10
10
|
|
11
|
-
model_attr_accessor :operator,
|
12
|
-
model_attr_accessor :operand1,
|
13
|
-
model_attr_accessor :operand2,
|
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,
|
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
|
data/lib/expressir/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expressir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: liquid
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: parslet
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '1.0'
|
55
55
|
description: Expressir (“EXPRESS in Ruby”) is a Ruby parser for EXPRESS and a set
|
56
56
|
of tools for accessing EXPRESS data models.
|
57
57
|
email:
|