expressir 0.2.14 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90636f5b51e37945b5d09af405067c5ef6112b0a102c44b635c090fd131b6079
4
- data.tar.gz: dcf949e38b11c0924f155bb5148a9de6aa56fd36462fc661fab7a281c98a06dd
3
+ metadata.gz: 01b9d48b15ce85744e4c19cbe55752d22744388f738367cd486f2afa2ac10835
4
+ data.tar.gz: 44fbef691d15a6c0feee280e86aabda10401f6b5d344fc3596cbc7315e816c76
5
5
  SHA512:
6
- metadata.gz: 7d5a3c69aa4993f017492d0af109bcf28edfa50e4a7456b420d5147640ef02b5cd1622b4c3a44460471b409bd13d65cefae73161233b05f59c31451bd8a33e2d
7
- data.tar.gz: d60a953be1fe08916538bb83a6eb0d45c29cf8b008342c821c4d735821a04e03831edbd7c6d9a669fa44e9c7779d31176c39b87c3977d58a643a8ee30240a39c
6
+ metadata.gz: 8049d49a9c11790c0fb45a3d37e5d8574b18aaf7d3de92b9dd870668bf6131005ff2ce1630d391962dbd6c936ea80d9d6cf95cdca0f6926358640b1ca46e9312
7
+ data.tar.gz: d90065bbfda420df3dce91ad2b016e14a145d751f70914823f0d5db8b86ff212c0c4ebce20f77d2a6fa85a343d91e172c3094a66a851db6af64d95af9495aa84
data/exe/format CHANGED
@@ -4,17 +4,24 @@ require "expressir/express_exp/parser"
4
4
  require "expressir/express_exp/hyperlink_formatter"
5
5
 
6
6
  input_files = [
7
- '../iso-10303-stepmod/data/resources/action_schema/action_schema_annotated.exp',
8
- '../iso-10303-stepmod/data/resources/basic_attribute_schema/basic_attribute_schema_annotated.exp',
9
- '../iso-10303-stepmod/data/resources/support_resource_schema/support_resource_schema_annotated.exp',
10
- # cyclic reference
7
+ # basic test
8
+ # '../iso-10303-stepmod/data/resources/action_schema/action_schema_annotated.exp',
9
+ # '../iso-10303-stepmod/data/resources/basic_attribute_schema/basic_attribute_schema_annotated.exp',
10
+ # '../iso-10303-stepmod/data/resources/support_resource_schema/support_resource_schema_annotated.exp',
11
+ # cyclic reference test
11
12
  # '../iso-10303-stepmod/data/resources/product_property_definition_schema/product_property_definition_schema_annotated.exp',
12
13
  # '../iso-10303-stepmod/data/resources/product_property_representation_schema/product_property_representation_schema_annotated.exp'
14
+ # renamed reference test
15
+ '../iso-10303-stepmod/ballots/ballots/ap210_wg12/express/resources/mathematical_functions_schema.exp',
16
+ '../iso-10303-stepmod/data/resources/iso13584_expressions_schema/iso13584_expressions_schema.exp',
17
+ # all valid iso-10303-stepmod files (takes 10 min)
18
+ # *`bundle exec ../stepmod-utils/exe/stepmod-find-express-files ../iso-10303-stepmod`.strip.split("\n").map{|file| File.exists?(file.sub(/\.exp$/, '_annotated.exp')) ? file.sub(/\.exp$/, '_annotated.exp') : file}
13
19
  ]
14
20
 
15
21
  repo = Expressir::ExpressExp::Parser.from_files(input_files)
16
- schema = repo.schemas.find{|x| x.id == 'action_schema'}
22
+ # schema = repo.schemas.find{|x| x.id == 'action_schema'}
17
23
  # schema = repo.schemas.find{|x| x.id == 'product_property_definition_schema'}
24
+ schema = repo.schemas.find{|x| x.id == 'mathematical_functions_schema'}
18
25
  result = Expressir::ExpressExp::HyperlinkFormatter.format(schema)
19
26
 
20
27
  puts result
@@ -50,12 +50,12 @@ module Expressir
50
50
  format_function(node)
51
51
  elsif node.is_a? Model::Interface
52
52
  format_interface(node)
53
+ elsif node.is_a? Model::InterfaceItem
54
+ format_interface_item(node)
53
55
  elsif node.is_a? Model::Parameter
54
56
  format_parameter(node)
55
57
  elsif node.is_a? Model::Procedure
56
58
  format_procedure(node)
57
- elsif node.is_a? Model::RenamedRef
58
- format_renamed_ref(node)
59
59
  elsif node.is_a? Model::Repository
60
60
  format_repository(node)
61
61
  elsif node.is_a? Model::Rule
@@ -419,6 +419,20 @@ module Expressir
419
419
  ].join('')
420
420
  end
421
421
 
422
+ def format_interface_item(node)
423
+ [
424
+ format(node.ref),
425
+ *if node.id
426
+ [
427
+ ' ',
428
+ 'AS',
429
+ ' ',
430
+ node.id
431
+ ]
432
+ end
433
+ ].join('')
434
+ end
435
+
422
436
  def format_parameter(node)
423
437
  [
424
438
  *if node.var
@@ -495,16 +509,6 @@ module Expressir
495
509
  ].join("\n")
496
510
  end
497
511
 
498
- def format_renamed_ref(node)
499
- [
500
- format(node.ref),
501
- ' ',
502
- 'AS',
503
- ' ',
504
- node.id
505
- ].join('')
506
- end
507
-
508
512
  def format_repository(node)
509
513
  [
510
514
  *if node.schemas and node.schemas.length > 0
@@ -7,7 +7,11 @@ module Expressir
7
7
  return node.id if node.parent.is_a? Model::Expressions::AttributeReference
8
8
 
9
9
  # skip hyperlink if target node can't be found
10
- target_node = node.find(node.id)
10
+ target_node = if node.parent.is_a? Model::InterfaceItem
11
+ node.find("#{node.parent.parent.schema.id}.#{node.parent.ref.id}")
12
+ else
13
+ node.find(node.id)
14
+ end
11
15
  return node.id unless target_node
12
16
 
13
17
  # skip hyperlink for implicit scopes
@@ -42,9 +42,13 @@ module Expressir
42
42
  def self.from_files(files)
43
43
  schemas = files.map{|file| self.from_file(file).schemas}.flatten
44
44
 
45
- Model::Repository.new({
45
+ repo = Model::Repository.new({
46
46
  schemas: schemas
47
47
  })
48
+
49
+ repo.schemas.each{|schema| schema.parent = repo}
50
+
51
+ repo
48
52
  end
49
53
 
50
54
  # deprecated
@@ -691,9 +691,9 @@ module Expressir
691
691
  expression = visit_if(ctx__expression)
692
692
 
693
693
  Model::Attribute.new({
694
- id: attribute.id,
694
+ id: attribute.id, # reuse
695
695
  kind: Model::Attribute::DERIVED,
696
- supertype_attribute: attribute.supertype_attribute,
696
+ supertype_attribute: attribute.supertype_attribute, # reuse
697
697
  type: type,
698
698
  expression: expression
699
699
  })
@@ -879,9 +879,9 @@ module Expressir
879
879
 
880
880
  attributes.map do |attribute|
881
881
  Model::Attribute.new({
882
- id: attribute.id,
882
+ id: attribute.id, # reuse
883
883
  kind: Model::Attribute::EXPLICIT,
884
- supertype_attribute: attribute.supertype_attribute,
884
+ supertype_attribute: attribute.supertype_attribute, # reuse
885
885
  optional: optional,
886
886
  type: type
887
887
  })
@@ -1306,9 +1306,9 @@ module Expressir
1306
1306
  end
1307
1307
 
1308
1308
  Model::Attribute.new({
1309
- id: attribute.id,
1309
+ id: attribute.id, # reuse
1310
1310
  kind: Model::Attribute::INVERSE,
1311
- supertype_attribute: attribute.supertype_attribute,
1311
+ supertype_attribute: attribute.supertype_attribute, # reuse
1312
1312
  type: type,
1313
1313
  expression: expression
1314
1314
  })
@@ -1490,14 +1490,10 @@ module Expressir
1490
1490
  ref = visit_if(ctx__named_types)
1491
1491
  id = visit_if(ctx__entity_id || ctx__type_id)
1492
1492
 
1493
- if id
1494
- Model::RenamedRef.new({
1495
- ref: ref,
1496
- id: id
1497
- })
1498
- else
1499
- ref
1500
- end
1493
+ Model::InterfaceItem.new({
1494
+ ref: ref,
1495
+ id: id
1496
+ })
1501
1497
  end
1502
1498
 
1503
1499
  def visit_null_stmt(ctx)
@@ -1674,9 +1670,9 @@ module Expressir
1674
1670
  ref: Model::Expressions::SimpleReference.new({
1675
1671
  id: id
1676
1672
  }),
1677
- entity: group_reference.entity
1673
+ entity: group_reference.entity # reuse
1678
1674
  }),
1679
- attribute: attribute_reference.attribute
1675
+ attribute: attribute_reference.attribute # reuse
1680
1676
  })
1681
1677
  end
1682
1678
 
@@ -1844,14 +1840,10 @@ module Expressir
1844
1840
  ref = visit_if(ctx__resource_ref)
1845
1841
  id = visit_if(ctx__rename_id)
1846
1842
 
1847
- if id
1848
- Model::RenamedRef.new({
1849
- ref: ref,
1850
- id: id
1851
- })
1852
- else
1853
- ref
1854
- end
1843
+ Model::InterfaceItem.new({
1844
+ ref: ref,
1845
+ id: id
1846
+ })
1855
1847
  end
1856
1848
 
1857
1849
  def visit_resource_ref(ctx)
@@ -9,9 +9,10 @@ require 'expressir/model/enumeration_item'
9
9
  require 'expressir/model/function'
10
10
  require 'expressir/model/informal_proposition'
11
11
  require 'expressir/model/interface'
12
+ require 'expressir/model/interface_item'
13
+ require 'expressir/model/interfaced_item'
12
14
  require 'expressir/model/parameter'
13
15
  require 'expressir/model/procedure'
14
- require 'expressir/model/renamed_ref'
15
16
  require 'expressir/model/repository'
16
17
  require 'expressir/model/rule'
17
18
  require 'expressir/model/schema'
@@ -37,7 +37,7 @@ module Expressir
37
37
  items = []
38
38
  items.push(*@parameters)
39
39
  items.push(*@types)
40
- items.push(*@types.flat_map{|x| x.type.is_a?(Expressir::Model::Types::Enumeration) ? x.type.items : []})
40
+ items.push(*@types.flat_map{|x| x.type.is_a?(Types::Enumeration) ? x.type.items : []})
41
41
  items.push(*@entities)
42
42
  items.push(*@subtype_constraints)
43
43
  items.push(*@functions)
@@ -1,11 +1,11 @@
1
1
  module Expressir
2
2
  module Model
3
- class RenamedRef < ModelElement
3
+ class InterfaceItem < ModelElement
4
4
  attr_accessor :ref
5
5
  attr_accessor :id
6
6
 
7
7
  def initialize(options = {})
8
- @ref = options[:ref]
8
+ @ref = options[:ref]
9
9
  @id = options[:id]
10
10
 
11
11
  super
@@ -0,0 +1,23 @@
1
+ module Expressir
2
+ module Model
3
+ class InterfacedItem < ModelElement
4
+ include Identifier
5
+
6
+ attr_accessor :base_item
7
+
8
+ def initialize(options = {})
9
+ @id = options[:id]
10
+ @remarks = options.fetch(:remarks, [])
11
+ @source = options[:source]
12
+
13
+ @base_item = options[:base_item]
14
+
15
+ super
16
+ end
17
+
18
+ def path
19
+ base_item.path
20
+ end
21
+ end
22
+ end
23
+ end
@@ -35,7 +35,7 @@ module Expressir
35
35
  items = []
36
36
  items.push(*@parameters)
37
37
  items.push(*@types)
38
- items.push(*@types.flat_map{|x| x.type.is_a?(Expressir::Model::Types::Enumeration) ? x.type.items : []})
38
+ items.push(*@types.flat_map{|x| x.type.is_a?(Types::Enumeration) ? x.type.items : []})
39
39
  items.push(*@entities)
40
40
  items.push(*@subtype_constraints)
41
41
  items.push(*@functions)
@@ -38,7 +38,7 @@ module Expressir
38
38
  def children
39
39
  items = []
40
40
  items.push(*@types)
41
- items.push(*@types.flat_map{|x| x.type.is_a?(Expressir::Model::Types::Enumeration) ? x.type.items : []})
41
+ items.push(*@types.flat_map{|x| x.type.is_a?(Types::Enumeration) ? x.type.items : []})
42
42
  items.push(*@entities)
43
43
  items.push(*@subtype_constraints)
44
44
  items.push(*@functions)
@@ -38,30 +38,53 @@ module Expressir
38
38
  super
39
39
  end
40
40
 
41
- def children(item_ids = nil)
41
+ def children(skip_references = false)
42
42
  items = []
43
- unless item_ids and item_ids.length > 0
43
+ unless skip_references
44
44
  items.push(*@interfaces.flat_map do |interface|
45
- schema = parent.schemas.find{|y| interface.schema.id == y.id}
46
- interface_item_ids = if interface.items
47
- # TODO: support renamed references
48
- interface.items.select{|x| x.is_a? Model::Expressions::SimpleReference}.map{|x| x.id}
45
+ schema_id = interface.schema.id.downcase
46
+ schema = parent.schemas.find{|x| x.id.downcase == schema_id}
47
+ if schema
48
+ schema_children = schema.children(true) # prevent infinite recursion
49
+ if interface.items.length > 0
50
+ interface.items.map do |item|
51
+ ref_id = item.ref.id.downcase
52
+ id = item.id || ref_id
53
+ base_item = schema_children.find{|x| x.id and x.id.downcase == ref_id}
54
+
55
+ interfaced_item = InterfacedItem.new({
56
+ id: id
57
+ })
58
+ interfaced_item.base_item = base_item # skip overriding parent
59
+ interfaced_item.parent = self
60
+ interfaced_item
61
+ end
62
+ else
63
+ schema_children.map do |item|
64
+ id = item.id
65
+ base_item = item
66
+
67
+ interfaced_item = InterfacedItem.new({
68
+ id: id
69
+ })
70
+ interfaced_item.base_item = base_item # skip overriding parent
71
+ interfaced_item.parent = self
72
+ interfaced_item
73
+ end
74
+ end
75
+ else
76
+ []
49
77
  end
50
- schema_items = schema&.children(interface_item_ids) || []
51
- schema_items
52
78
  end)
53
79
  end
54
80
  items.push(*@constants)
55
81
  items.push(*@types)
56
- items.push(*@types.flat_map{|x| x.type.is_a?(Expressir::Model::Types::Enumeration) ? x.type.items : []})
82
+ items.push(*@types.flat_map{|x| x.type.is_a?(Types::Enumeration) ? x.type.items : []})
57
83
  items.push(*@entities)
58
84
  items.push(*@subtype_constraints)
59
85
  items.push(*@functions)
60
86
  items.push(*@procedures)
61
87
  items.push(*@rules)
62
- if item_ids and item_ids.length > 0
63
- items = items.select{|x| item_ids.include?(x.id)}
64
- end
65
88
  items
66
89
  end
67
90
  end
@@ -21,7 +21,7 @@ module Expressir
21
21
 
22
22
  def children
23
23
  items = []
24
- items.push(*@type.is_a?(Expressir::Model::Types::Enumeration) ? @type.items : [])
24
+ items.push(*@type.is_a?(Types::Enumeration) ? @type.items : [])
25
25
  items.push(*@where)
26
26
  items.push(*@informal_propositions)
27
27
  items
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "0.2.14".freeze
2
+ VERSION = "0.2.15".freeze
3
3
  end
@@ -1,8 +1,23 @@
1
1
  SCHEMA hyperlink_schema;
2
+ REFERENCE FROM hyperlink_schema2;
3
+ REFERENCE FROM hyperlink_schema3 (attribute_entity3);
4
+ REFERENCE FROM hyperlink_schema4 (attribute_entity AS attribute_entity4);
2
5
  ENTITY test; END_ENTITY;
3
6
  ENTITY empty_entity; END_ENTITY;
4
7
  ENTITY attribute_entity; test : BOOLEAN; END_ENTITY;
5
8
  ENTITY subtype_empty_entity SUBTYPE OF (empty_entity); END_ENTITY;
6
9
  ENTITY subtype_attribute_entity SUBTYPE OF (attribute_entity); SELF\attribute_entity.test : BOOLEAN; END_ENTITY;
10
+ ENTITY subtype_attribute_entity2 SUBTYPE OF (attribute_entity2); SELF\attribute_entity2.test : BOOLEAN; END_ENTITY;
11
+ ENTITY subtype_attribute_entity3 SUBTYPE OF (attribute_entity3); SELF\attribute_entity3.test : BOOLEAN; END_ENTITY;
12
+ ENTITY subtype_attribute_entity4 SUBTYPE OF (attribute_entity4); SELF\attribute_entity4.test : BOOLEAN; END_ENTITY;
7
13
  ENTITY subtype_missing_entity SUBTYPE OF (missing_entity); END_ENTITY;
8
14
  END_SCHEMA;
15
+ SCHEMA hyperlink_schema2;
16
+ ENTITY attribute_entity2; test : BOOLEAN; END_ENTITY;
17
+ END_SCHEMA;
18
+ SCHEMA hyperlink_schema3;
19
+ ENTITY attribute_entity3; test : BOOLEAN; END_ENTITY;
20
+ END_SCHEMA;
21
+ SCHEMA hyperlink_schema4;
22
+ ENTITY attribute_entity; test : BOOLEAN; END_ENTITY;
23
+ END_SCHEMA;
@@ -1,4 +1,9 @@
1
1
  SCHEMA hyperlink_schema;
2
+ REFERENCE FROM {{{<<express:hyperlink_schema2,hyperlink_schema2>>}}};
3
+ REFERENCE FROM {{{<<express:hyperlink_schema3,hyperlink_schema3>>}}}
4
+ ({{{<<express:hyperlink_schema3.attribute_entity3,attribute_entity3>>}}});
5
+ REFERENCE FROM {{{<<express:hyperlink_schema4,hyperlink_schema4>>}}}
6
+ ({{{<<express:hyperlink_schema4.attribute_entity,attribute_entity>>}}} AS attribute_entity4);
2
7
  ENTITY test;
3
8
  END_ENTITY;
4
9
  ENTITY empty_entity;
@@ -13,7 +18,34 @@ ENTITY subtype_attribute_entity
13
18
  SUBTYPE OF ({{{<<express:hyperlink_schema.attribute_entity,attribute_entity>>}}});
14
19
  SELF\{{{<<express:hyperlink_schema.attribute_entity,attribute_entity>>}}}.test : BOOLEAN;
15
20
  END_ENTITY;
21
+ ENTITY subtype_attribute_entity2
22
+ SUBTYPE OF ({{{<<express:hyperlink_schema2.attribute_entity2,attribute_entity2>>}}});
23
+ SELF\{{{<<express:hyperlink_schema2.attribute_entity2,attribute_entity2>>}}}.test : BOOLEAN;
24
+ END_ENTITY;
25
+ ENTITY subtype_attribute_entity3
26
+ SUBTYPE OF ({{{<<express:hyperlink_schema3.attribute_entity3,attribute_entity3>>}}});
27
+ SELF\{{{<<express:hyperlink_schema3.attribute_entity3,attribute_entity3>>}}}.test : BOOLEAN;
28
+ END_ENTITY;
29
+ ENTITY subtype_attribute_entity4
30
+ SUBTYPE OF ({{{<<express:hyperlink_schema4.attribute_entity,attribute_entity4>>}}});
31
+ SELF\{{{<<express:hyperlink_schema4.attribute_entity,attribute_entity4>>}}}.test : BOOLEAN;
32
+ END_ENTITY;
16
33
  ENTITY subtype_missing_entity
17
34
  SUBTYPE OF (missing_entity);
18
35
  END_ENTITY;
36
+ END_SCHEMA;
37
+ SCHEMA hyperlink_schema2;
38
+ ENTITY attribute_entity2;
39
+ test : BOOLEAN;
40
+ END_ENTITY;
41
+ END_SCHEMA;
42
+ SCHEMA hyperlink_schema3;
43
+ ENTITY attribute_entity3;
44
+ test : BOOLEAN;
45
+ END_ENTITY;
46
+ END_SCHEMA;
47
+ SCHEMA hyperlink_schema4;
48
+ ENTITY attribute_entity;
49
+ test : BOOLEAN;
50
+ END_ENTITY;
19
51
  END_SCHEMA;
@@ -36,8 +36,9 @@ RSpec.describe Expressir::ExpressExp::Parser do
36
36
  expect(x.schema.id).to eq("contract_schema")
37
37
  expect(x.items).to be_instance_of(Array)
38
38
  expect(x.items.count).to eq(1)
39
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
40
- expect(x.items[0].id).to eq("contract")
39
+ expect(x.items[0]).to be_instance_of(Expressir::Model::InterfaceItem)
40
+ expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
41
+ expect(x.items[0].ref.id).to eq("contract")
41
42
  end
42
43
 
43
44
  interfaces[2].tap do |x|
@@ -47,10 +48,12 @@ RSpec.describe Expressir::ExpressExp::Parser do
47
48
  expect(x.schema.id).to eq("contract_schema")
48
49
  expect(x.items).to be_instance_of(Array)
49
50
  expect(x.items.count).to eq(2)
50
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
51
- expect(x.items[0].id).to eq("contract")
52
- expect(x.items[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
53
- expect(x.items[1].id).to eq("contract2")
51
+ expect(x.items[0]).to be_instance_of(Expressir::Model::InterfaceItem)
52
+ expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
53
+ expect(x.items[0].ref.id).to eq("contract")
54
+ expect(x.items[1]).to be_instance_of(Expressir::Model::InterfaceItem)
55
+ expect(x.items[1].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
56
+ expect(x.items[1].ref.id).to eq("contract2")
54
57
  end
55
58
 
56
59
  interfaces[3].tap do |x|
@@ -60,10 +63,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
60
63
  expect(x.schema.id).to eq("contract_schema")
61
64
  expect(x.items).to be_instance_of(Array)
62
65
  expect(x.items.count).to eq(1)
63
- expect(x.items[0]).to be_instance_of(Expressir::Model::RenamedRef)
66
+ expect(x.items[0]).to be_instance_of(Expressir::Model::InterfaceItem)
67
+ expect(x.items[0].id).to eq("contract2")
64
68
  expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
65
69
  expect(x.items[0].ref.id).to eq("contract")
66
- expect(x.items[0].id).to eq("contract2")
67
70
  end
68
71
 
69
72
  interfaces[4].tap do |x|
@@ -80,8 +83,9 @@ RSpec.describe Expressir::ExpressExp::Parser do
80
83
  expect(x.schema.id).to eq("contract_schema")
81
84
  expect(x.items).to be_instance_of(Array)
82
85
  expect(x.items.count).to eq(1)
83
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
84
- expect(x.items[0].id).to eq("contract")
86
+ expect(x.items[0]).to be_instance_of(Expressir::Model::InterfaceItem)
87
+ expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
88
+ expect(x.items[0].ref.id).to eq("contract")
85
89
  end
86
90
 
87
91
  interfaces[6].tap do |x|
@@ -91,10 +95,12 @@ RSpec.describe Expressir::ExpressExp::Parser do
91
95
  expect(x.schema.id).to eq("contract_schema")
92
96
  expect(x.items).to be_instance_of(Array)
93
97
  expect(x.items.count).to eq(2)
94
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
95
- expect(x.items[0].id).to eq("contract")
96
- expect(x.items[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
97
- expect(x.items[1].id).to eq("contract2")
98
+ expect(x.items[0]).to be_instance_of(Expressir::Model::InterfaceItem)
99
+ expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
100
+ expect(x.items[0].ref.id).to eq("contract")
101
+ expect(x.items[1]).to be_instance_of(Expressir::Model::InterfaceItem)
102
+ expect(x.items[1].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
103
+ expect(x.items[1].ref.id).to eq("contract2")
98
104
  end
99
105
 
100
106
  interfaces[7].tap do |x|
@@ -104,10 +110,10 @@ RSpec.describe Expressir::ExpressExp::Parser do
104
110
  expect(x.schema.id).to eq("contract_schema")
105
111
  expect(x.items).to be_instance_of(Array)
106
112
  expect(x.items.count).to eq(1)
107
- expect(x.items[0]).to be_instance_of(Expressir::Model::RenamedRef)
113
+ expect(x.items[0]).to be_instance_of(Expressir::Model::InterfaceItem)
114
+ expect(x.items[0].id).to eq("contract2")
108
115
  expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
109
116
  expect(x.items[0].ref.id).to eq("contract")
110
- expect(x.items[0].id).to eq("contract2")
111
117
  end
112
118
 
113
119
  # constants
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-26 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -595,6 +595,8 @@ files:
595
595
  - lib/expressir/model/identifier.rb
596
596
  - lib/expressir/model/informal_proposition.rb
597
597
  - lib/expressir/model/interface.rb
598
+ - lib/expressir/model/interface_item.rb
599
+ - lib/expressir/model/interfaced_item.rb
598
600
  - lib/expressir/model/literals/binary.rb
599
601
  - lib/expressir/model/literals/integer.rb
600
602
  - lib/expressir/model/literals/logical.rb
@@ -603,7 +605,6 @@ files:
603
605
  - lib/expressir/model/model_element.rb
604
606
  - lib/expressir/model/parameter.rb
605
607
  - lib/expressir/model/procedure.rb
606
- - lib/expressir/model/renamed_ref.rb
607
608
  - lib/expressir/model/repository.rb
608
609
  - lib/expressir/model/rule.rb
609
610
  - lib/expressir/model/schema.rb