expressir 0.2.26-arm64-darwin → 0.2.27-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/expressir/express_exp/2.4/express_parser.bundle +0 -0
  3. data/lib/expressir/express_exp/2.5/express_parser.bundle +0 -0
  4. data/lib/expressir/express_exp/2.6/express_parser.bundle +0 -0
  5. data/lib/expressir/express_exp/2.7/express_parser.bundle +0 -0
  6. data/lib/expressir/express_exp/formatter.rb +10 -0
  7. data/lib/expressir/express_exp/visitor.rb +27 -1
  8. data/lib/expressir/model.rb +2 -0
  9. data/lib/expressir/model/attribute.rb +2 -2
  10. data/lib/expressir/model/constant.rb +2 -2
  11. data/lib/expressir/model/entity.rb +7 -7
  12. data/lib/expressir/model/enumeration_item.rb +2 -2
  13. data/lib/expressir/model/expressions/aggregate_initializer.rb +1 -1
  14. data/lib/expressir/model/expressions/call.rb +1 -1
  15. data/lib/expressir/model/expressions/entity_constructor.rb +1 -1
  16. data/lib/expressir/model/expressions/query_expression.rb +2 -2
  17. data/lib/expressir/model/function.rb +11 -11
  18. data/lib/expressir/model/interface.rb +1 -1
  19. data/lib/expressir/model/interfaced_item.rb +2 -2
  20. data/lib/expressir/model/parameter.rb +2 -2
  21. data/lib/expressir/model/procedure.rb +11 -11
  22. data/lib/expressir/model/remark_item.rb +1 -1
  23. data/lib/expressir/model/repository.rb +1 -1
  24. data/lib/expressir/model/rule.rb +13 -13
  25. data/lib/expressir/model/schema.rb +10 -10
  26. data/lib/expressir/model/schema_version.rb +15 -0
  27. data/lib/expressir/model/schema_version_item.rb +15 -0
  28. data/lib/expressir/model/statements/alias.rb +3 -3
  29. data/lib/expressir/model/statements/call.rb +1 -1
  30. data/lib/expressir/model/statements/case.rb +1 -1
  31. data/lib/expressir/model/statements/case_action.rb +1 -1
  32. data/lib/expressir/model/statements/compound.rb +1 -1
  33. data/lib/expressir/model/statements/if.rb +2 -2
  34. data/lib/expressir/model/statements/repeat.rb +3 -3
  35. data/lib/expressir/model/subtype_constraint.rb +3 -3
  36. data/lib/expressir/model/type.rb +4 -4
  37. data/lib/expressir/model/types/aggregate.rb +2 -2
  38. data/lib/expressir/model/types/enumeration.rb +2 -2
  39. data/lib/expressir/model/types/generic.rb +2 -2
  40. data/lib/expressir/model/types/generic_entity.rb +2 -2
  41. data/lib/expressir/model/types/select.rb +2 -2
  42. data/lib/expressir/model/unique.rb +3 -3
  43. data/lib/expressir/model/variable.rb +2 -2
  44. data/lib/expressir/model/where.rb +2 -2
  45. data/lib/expressir/version.rb +1 -1
  46. data/original/examples/syntax/single.exp +1 -1
  47. data/original/examples/syntax/single.yaml +3 -0
  48. data/original/examples/syntax/single_formatted.exp +1 -1
  49. data/original/examples/syntax/single_formatted.yaml +4 -1
  50. data/original/examples/syntax/syntax.exp +1 -1
  51. data/original/examples/syntax/syntax.yaml +18 -2
  52. data/original/examples/syntax/syntax_formatted.exp +1 -1
  53. data/original/examples/syntax/syntax_hyperlink_formatted.exp +1 -1
  54. data/original/examples/syntax/syntax_schema_head_formatted.exp +1 -1
  55. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c97108da470f2f536888b5aa383db896e330a6452580a918d0a8071a5a694d72
4
- data.tar.gz: fcf0cc508f86bc62c6c17f52b8ea309154f2184628ca7dbcd613b79ae2e9828c
3
+ metadata.gz: 8d8f3802280511fdf1ccf27f8fcba3831f715a5c9b36ccb17970032effc61d23
4
+ data.tar.gz: 62fa1fd2523e69be7b7a0b1e46f183dd1e49cd237fe3a3023deeae433a3a09d7
5
5
  SHA512:
6
- metadata.gz: e74050647e050606233264c7843eca50d1f63dd8ea90758d83bb5f5480a83be5c10396390314845e703dd1fcbc2e72826d7bfd3afbddc74dcf604c4e7066da64
7
- data.tar.gz: 4e156a923124e6493b41c74cf811c24ced5e981102ce2295f3a79353305beab2257db5457311314b351d930a284420467b3dd53572b5c89db7e4d0c9ad88f14d
6
+ metadata.gz: 927db026109a9481f61ac086e6b40983aaa5f66d5cb399b297dcf9bec0c31edd6c552b28db82f9e53e6f9f0017f1300e568d87b3b324db863d9a11116c03105c
7
+ data.tar.gz: 32b737367314f50e39d90a8726a0f8ee66091b9b923f7fc4b842831992fef6f3b9bc158565dca4030bdb9f71514e88e85aaad294047da81cb214e91948317dbb
@@ -62,6 +62,8 @@ module Expressir
62
62
  format_rule(node)
63
63
  elsif node.is_a? Model::Schema
64
64
  format_schema(node)
65
+ elsif node.is_a? Model::SchemaVersion
66
+ format_schema_version(node)
65
67
  elsif node.is_a? Model::SubtypeConstraint
66
68
  format_subtype_constraint(node)
67
69
  elsif node.is_a? Model::Type
@@ -659,6 +661,14 @@ module Expressir
659
661
  ].join("\n")
660
662
  end
661
663
 
664
+ def format_schema_version(node)
665
+ [
666
+ "'",
667
+ node.value,
668
+ "'"
669
+ ].join('')
670
+ end
671
+
662
672
  def format_subtype_constraint(node)
663
673
  [
664
674
  [
@@ -1957,7 +1957,33 @@ module Expressir
1957
1957
  def visit_schema_version_id(ctx)
1958
1958
  ctx__string_literal = ctx.string_literal
1959
1959
 
1960
- visit_if(ctx__string_literal)
1960
+ value = visit_if(ctx__string_literal)
1961
+ value = value.value
1962
+
1963
+ items = if value.start_with?('{') and value.end_with?('}')
1964
+ parts = value.sub(/^\{/, '').sub(/\}$/, '').split(' ')
1965
+ parts.map do |part|
1966
+ if match = part.match(/^(.+)\((\d+)\)$/)
1967
+ Model::SchemaVersionItem.new({
1968
+ name: match[1],
1969
+ value: match[2]
1970
+ })
1971
+ elsif part.match(/^\d+$/)
1972
+ Model::SchemaVersionItem.new({
1973
+ value: part
1974
+ })
1975
+ else
1976
+ Model::SchemaVersionItem.new({
1977
+ name: part
1978
+ })
1979
+ end
1980
+ end
1981
+ end
1982
+
1983
+ Model::SchemaVersion.new({
1984
+ value: value,
1985
+ items: items
1986
+ })
1961
1987
  end
1962
1988
 
1963
1989
  def visit_selector(ctx)
@@ -18,6 +18,8 @@ require 'expressir/model/remark_item'
18
18
  require 'expressir/model/repository'
19
19
  require 'expressir/model/rule'
20
20
  require 'expressir/model/schema'
21
+ require 'expressir/model/schema_version'
22
+ require 'expressir/model/schema_version_item'
21
23
  require 'expressir/model/subtype_constraint'
22
24
  require 'expressir/model/type'
23
25
  require 'expressir/model/unique'
@@ -15,8 +15,8 @@ module Expressir
15
15
 
16
16
  def initialize(options = {})
17
17
  @id = options[:id]
18
- @remarks = options.fetch(:remarks, [])
19
- @remark_items = options.fetch(:remark_items, [])
18
+ @remarks = options[:remarks] || []
19
+ @remark_items = options[:remark_items] || []
20
20
  @source = options[:source]
21
21
 
22
22
  @kind = options[:kind]
@@ -8,8 +8,8 @@ module Expressir
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
- @remarks = options.fetch(:remarks, [])
12
- @remark_items = options.fetch(:remark_items, [])
11
+ @remarks = options[:remarks] || []
12
+ @remark_items = options[:remark_items] || []
13
13
  @source = options[:source]
14
14
 
15
15
  @type = options[:type]
@@ -13,17 +13,17 @@ module Expressir
13
13
 
14
14
  def initialize(options = {})
15
15
  @id = options[:id]
16
- @remarks = options.fetch(:remarks, [])
17
- @remark_items = options.fetch(:remark_items, [])
16
+ @remarks = options[:remarks] || []
17
+ @remark_items = options[:remark_items] || []
18
18
  @source = options[:source]
19
19
 
20
20
  @abstract = options[:abstract]
21
21
  @supertype_expression = options[:supertype_expression]
22
- @subtype_of = options.fetch(:subtype_of, [])
23
- @attributes = options.fetch(:attributes, [])
24
- @unique = options.fetch(:unique, [])
25
- @where = options.fetch(:where, [])
26
- @informal_propositions = options.fetch(:informal_propositions, [])
22
+ @subtype_of = options[:subtype_of] || []
23
+ @attributes = options[:attributes] || []
24
+ @unique = options[:unique] || []
25
+ @where = options[:where] || []
26
+ @informal_propositions = options[:informal_propositions] || []
27
27
 
28
28
  super
29
29
  end
@@ -5,8 +5,8 @@ module Expressir
5
5
 
6
6
  def initialize(options = {})
7
7
  @id = options[:id]
8
- @remarks = options.fetch(:remarks, [])
9
- @remark_items = options.fetch(:remark_items, [])
8
+ @remarks = options[:remarks] || []
9
+ @remark_items = options[:remark_items] || []
10
10
  @source = options[:source]
11
11
 
12
12
  super
@@ -5,7 +5,7 @@ module Expressir
5
5
  model_attr_accessor :items
6
6
 
7
7
  def initialize(options = {})
8
- @items = options.fetch(:items, [])
8
+ @items = options[:items] || []
9
9
 
10
10
  super
11
11
  end
@@ -7,7 +7,7 @@ module Expressir
7
7
 
8
8
  def initialize(options = {})
9
9
  @ref = options[:ref]
10
- @parameters = options.fetch(:parameters, [])
10
+ @parameters = options[:parameters] || []
11
11
 
12
12
  super
13
13
  end
@@ -7,7 +7,7 @@ module Expressir
7
7
 
8
8
  def initialize(options = {})
9
9
  @entity = options[:entity]
10
- @parameters = options.fetch(:parameters, [])
10
+ @parameters = options[:parameters] || []
11
11
 
12
12
  super
13
13
  end
@@ -9,8 +9,8 @@ module Expressir
9
9
 
10
10
  def initialize(options = {})
11
11
  @id = options[:id]
12
- @remarks = options.fetch(:remarks, [])
13
- @remark_items = options.fetch(:remark_items, [])
12
+ @remarks = options[:remarks] || []
13
+ @remark_items = options[:remark_items] || []
14
14
  @source = options[:source]
15
15
 
16
16
  @aggregate_source = options[:aggregate_source]
@@ -16,20 +16,20 @@ module Expressir
16
16
 
17
17
  def initialize(options = {})
18
18
  @id = options[:id]
19
- @remarks = options.fetch(:remarks, [])
20
- @remark_items = options.fetch(:remark_items, [])
19
+ @remarks = options[:remarks] || []
20
+ @remark_items = options[:remark_items] || []
21
21
  @source = options[:source]
22
22
 
23
- @parameters = options.fetch(:parameters, [])
23
+ @parameters = options[:parameters] || []
24
24
  @return_type = options[:return_type]
25
- @types = options.fetch(:types, [])
26
- @entities = options.fetch(:entities, [])
27
- @subtype_constraints = options.fetch(:subtype_constraints, [])
28
- @functions = options.fetch(:functions, [])
29
- @procedures = options.fetch(:procedures, [])
30
- @constants = options.fetch(:constants, [])
31
- @variables = options.fetch(:variables, [])
32
- @statements = options.fetch(:statements, [])
25
+ @types = options[:types] || []
26
+ @entities = options[:entities] || []
27
+ @subtype_constraints = options[:subtype_constraints] || []
28
+ @functions = options[:functions] || []
29
+ @procedures = options[:procedures] || []
30
+ @constants = options[:constants] || []
31
+ @variables = options[:variables] || []
32
+ @statements = options[:statements] || []
33
33
 
34
34
  super
35
35
  end
@@ -11,7 +11,7 @@ module Expressir
11
11
  def initialize(options = {})
12
12
  @kind = options[:kind]
13
13
  @schema = options[:schema]
14
- @items = options.fetch(:items, [])
14
+ @items = options[:items] || []
15
15
 
16
16
  super
17
17
  end
@@ -9,8 +9,8 @@ module Expressir
9
9
 
10
10
  def initialize(options = {})
11
11
  @id = options[:id]
12
- @remarks = options.fetch(:remarks, [])
13
- @remark_items = options.fetch(:remark_items, [])
12
+ @remarks = options[:remarks] || []
13
+ @remark_items = options[:remark_items] || []
14
14
 
15
15
  @base_item = options[:base_item]
16
16
 
@@ -8,8 +8,8 @@ module Expressir
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
- @remarks = options.fetch(:remarks, [])
12
- @remark_items = options.fetch(:remark_items, [])
11
+ @remarks = options[:remarks] || []
12
+ @remark_items = options[:remark_items] || []
13
13
  @source = options[:source]
14
14
 
15
15
  @var = options[:var]
@@ -15,19 +15,19 @@ module Expressir
15
15
 
16
16
  def initialize(options = {})
17
17
  @id = options[:id]
18
- @remarks = options.fetch(:remarks, [])
19
- @remark_items = options.fetch(:remark_items, [])
18
+ @remarks = options[:remarks] || []
19
+ @remark_items = options[:remark_items] || []
20
20
  @source = options[:source]
21
21
 
22
- @parameters = options.fetch(:parameters, [])
23
- @types = options.fetch(:types, [])
24
- @entities = options.fetch(:entities, [])
25
- @subtype_constraints = options.fetch(:subtype_constraints, [])
26
- @functions = options.fetch(:functions, [])
27
- @procedures = options.fetch(:procedures, [])
28
- @constants = options.fetch(:constants, [])
29
- @variables = options.fetch(:variables, [])
30
- @statements = options.fetch(:statements, [])
22
+ @parameters = options[:parameters] || []
23
+ @types = options[:types] || []
24
+ @entities = options[:entities] || []
25
+ @subtype_constraints = options[:subtype_constraints] || []
26
+ @functions = options[:functions] || []
27
+ @procedures = options[:procedures] || []
28
+ @constants = options[:constants] || []
29
+ @variables = options[:variables] || []
30
+ @statements = options[:statements] || []
31
31
 
32
32
  super
33
33
  end
@@ -6,7 +6,7 @@ module Expressir
6
6
 
7
7
  def initialize(options = {})
8
8
  @id = options[:id]
9
- @remarks = options.fetch(:remarks, [])
9
+ @remarks = options[:remarks] || []
10
10
 
11
11
  super
12
12
  end
@@ -4,7 +4,7 @@ module Expressir
4
4
  model_attr_accessor :schemas
5
5
 
6
6
  def initialize(options = {})
7
- @schemas = options.fetch(:schemas, [])
7
+ @schemas = options[:schemas] || []
8
8
 
9
9
  super
10
10
  end
@@ -17,21 +17,21 @@ module Expressir
17
17
 
18
18
  def initialize(options = {})
19
19
  @id = options[:id]
20
- @remarks = options.fetch(:remarks, [])
21
- @remark_items = options.fetch(:remark_items, [])
20
+ @remarks = options[:remarks] || []
21
+ @remark_items = options[:remark_items] || []
22
22
  @source = options[:source]
23
23
 
24
- @applies_to = options.fetch(:applies_to, [])
25
- @types = options.fetch(:types, [])
26
- @entities = options.fetch(:entities, [])
27
- @subtype_constraints = options.fetch(:subtype_constraints, [])
28
- @functions = options.fetch(:functions, [])
29
- @procedures = options.fetch(:procedures, [])
30
- @constants = options.fetch(:constants, [])
31
- @variables = options.fetch(:variables, [])
32
- @statements = options.fetch(:statements, [])
33
- @where = options.fetch(:where, [])
34
- @informal_propositions = options.fetch(:informal_propositions, [])
24
+ @applies_to = options[:applies_to] || []
25
+ @types = options[:types] || []
26
+ @entities = options[:entities] || []
27
+ @subtype_constraints = options[:subtype_constraints] || []
28
+ @functions = options[:functions] || []
29
+ @procedures = options[:procedures] || []
30
+ @constants = options[:constants] || []
31
+ @variables = options[:variables] || []
32
+ @statements = options[:statements] || []
33
+ @where = options[:where] || []
34
+ @informal_propositions = options[:informal_propositions] || []
35
35
 
36
36
  super
37
37
  end
@@ -19,19 +19,19 @@ module Expressir
19
19
  @file = options[:file]
20
20
 
21
21
  @id = options[:id]
22
- @remarks = options.fetch(:remarks, [])
23
- @remark_items = options.fetch(:remark_items, [])
22
+ @remarks = options[:remarks] || []
23
+ @remark_items = options[:remark_items] || []
24
24
  @source = options[:source]
25
25
 
26
26
  @version = options[:version]
27
- @interfaces = options.fetch(:interfaces, [])
28
- @constants = options.fetch(:constants, [])
29
- @types = options.fetch(:types, [])
30
- @entities = options.fetch(:entities, [])
31
- @subtype_constraints = options.fetch(:subtype_constraints, [])
32
- @functions = options.fetch(:functions, [])
33
- @rules = options.fetch(:rules, [])
34
- @procedures = options.fetch(:procedures, [])
27
+ @interfaces = options[:interfaces] || []
28
+ @constants = options[:constants] || []
29
+ @types = options[:types] || []
30
+ @entities = options[:entities] || []
31
+ @subtype_constraints = options[:subtype_constraints] || []
32
+ @functions = options[:functions] || []
33
+ @rules = options[:rules] || []
34
+ @procedures = options[:procedures] || []
35
35
 
36
36
  super
37
37
  end
@@ -0,0 +1,15 @@
1
+ module Expressir
2
+ module Model
3
+ class SchemaVersion < ModelElement
4
+ model_attr_accessor :value
5
+ model_attr_accessor :items
6
+
7
+ def initialize(options = {})
8
+ @value = options[:value]
9
+ @items = options[:items] || []
10
+
11
+ super
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Expressir
2
+ module Model
3
+ class SchemaVersionItem < ModelElement
4
+ model_attr_accessor :name
5
+ model_attr_accessor :value
6
+
7
+ def initialize(options = {})
8
+ @name = options[:name]
9
+ @value = options[:value]
10
+
11
+ super
12
+ end
13
+ end
14
+ end
15
+ end
@@ -9,12 +9,12 @@ module Expressir
9
9
 
10
10
  def initialize(options = {})
11
11
  @id = options[:id]
12
- @remarks = options.fetch(:remarks, [])
13
- @remark_items = options.fetch(:remark_items, [])
12
+ @remarks = options[:remarks] || []
13
+ @remark_items = options[:remark_items] || []
14
14
  @source = options[:source]
15
15
 
16
16
  @expression = options[:expression]
17
- @statements = options.fetch(:statements, [])
17
+ @statements = options[:statements] || []
18
18
 
19
19
  super
20
20
  end
@@ -7,7 +7,7 @@ module Expressir
7
7
 
8
8
  def initialize(options = {})
9
9
  @ref = options[:ref]
10
- @parameters = options.fetch(:parameters, [])
10
+ @parameters = options[:parameters] || []
11
11
 
12
12
  super
13
13
  end
@@ -8,7 +8,7 @@ module Expressir
8
8
 
9
9
  def initialize(options = {})
10
10
  @expression = options[:expression]
11
- @actions = options.fetch(:actions, [])
11
+ @actions = options[:actions] || []
12
12
  @otherwise_statement = options[:otherwise_statement]
13
13
 
14
14
  super
@@ -6,7 +6,7 @@ module Expressir
6
6
  model_attr_accessor :statement
7
7
 
8
8
  def initialize(options = {})
9
- @labels = options.fetch(:labels, [])
9
+ @labels = options[:labels] || []
10
10
  @statement = options[:statement]
11
11
 
12
12
  super
@@ -5,7 +5,7 @@ module Expressir
5
5
  model_attr_accessor :statements
6
6
 
7
7
  def initialize(options = {})
8
- @statements = options.fetch(:statements, [])
8
+ @statements = options[:statements] || []
9
9
 
10
10
  super
11
11
  end
@@ -8,8 +8,8 @@ module Expressir
8
8
 
9
9
  def initialize(options = {})
10
10
  @expression = options[:expression]
11
- @statements = options.fetch(:statements, [])
12
- @else_statements = options.fetch(:else_statements, [])
11
+ @statements = options[:statements] || []
12
+ @else_statements = options[:else_statements] || []
13
13
 
14
14
  super
15
15
  end
@@ -13,8 +13,8 @@ module Expressir
13
13
 
14
14
  def initialize(options = {})
15
15
  @id = options[:id]
16
- @remarks = options.fetch(:remarks, [])
17
- @remark_items = options.fetch(:remark_items, [])
16
+ @remarks = options[:remarks] || []
17
+ @remark_items = options[:remark_items] || []
18
18
  @source = options[:source]
19
19
 
20
20
  @bound1 = options[:bound1]
@@ -22,7 +22,7 @@ module Expressir
22
22
  @increment = options[:increment]
23
23
  @while_expression = options[:while_expression]
24
24
  @until_expression = options[:until_expression]
25
- @statements = options.fetch(:statements, [])
25
+ @statements = options[:statements] || []
26
26
 
27
27
  super
28
28
  end
@@ -10,13 +10,13 @@ module Expressir
10
10
 
11
11
  def initialize(options = {})
12
12
  @id = options[:id]
13
- @remarks = options.fetch(:remarks, [])
14
- @remark_items = options.fetch(:remark_items, [])
13
+ @remarks = options[:remarks] || []
14
+ @remark_items = options[:remark_items] || []
15
15
  @source = options[:source]
16
16
 
17
17
  @applies_to = options[:applies_to]
18
18
  @abstract = options[:abstract]
19
- @total_over = options.fetch(:total_over, [])
19
+ @total_over = options[:total_over] || []
20
20
  @supertype_expression = options[:supertype_expression]
21
21
 
22
22
  super
@@ -9,13 +9,13 @@ module Expressir
9
9
 
10
10
  def initialize(options = {})
11
11
  @id = options[:id]
12
- @remarks = options.fetch(:remarks, [])
13
- @remark_items = options.fetch(:remark_items, [])
12
+ @remarks = options[:remarks] || []
13
+ @remark_items = options[:remark_items] || []
14
14
  @source = options[:source]
15
15
 
16
16
  @type = options[:type]
17
- @where = options.fetch(:where, [])
18
- @informal_propositions = options.fetch(:informal_propositions, [])
17
+ @where = options[:where] || []
18
+ @informal_propositions = options[:informal_propositions] || []
19
19
 
20
20
  super
21
21
  end
@@ -8,8 +8,8 @@ module Expressir
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
- @remarks = options.fetch(:remarks, [])
12
- @remark_items = options.fetch(:remark_items, [])
11
+ @remarks = options[:remarks] || []
12
+ @remark_items = options[:remark_items] || []
13
13
  @source = options[:source]
14
14
 
15
15
  @base_type = options[:base_type]
@@ -9,9 +9,9 @@ module Expressir
9
9
 
10
10
  def initialize(options = {})
11
11
  @extensible = options[:extensible]
12
- @items = options.fetch(:items, [])
12
+ @items = options[:items] || []
13
13
  @extension_type = options[:extension_type]
14
- @extension_items = options.fetch(:extension_items, [])
14
+ @extension_items = options[:extension_items] || []
15
15
 
16
16
  super
17
17
  end
@@ -6,8 +6,8 @@ module Expressir
6
6
 
7
7
  def initialize(options = {})
8
8
  @id = options[:id]
9
- @remarks = options.fetch(:remarks, [])
10
- @remark_items = options.fetch(:remark_items, [])
9
+ @remarks = options[:remarks] || []
10
+ @remark_items = options[:remark_items] || []
11
11
  @source = options[:source]
12
12
 
13
13
  super
@@ -6,8 +6,8 @@ module Expressir
6
6
 
7
7
  def initialize(options = {})
8
8
  @id = options[:id]
9
- @remarks = options.fetch(:remarks, [])
10
- @remark_items = options.fetch(:remark_items, [])
9
+ @remarks = options[:remarks] || []
10
+ @remark_items = options[:remark_items] || []
11
11
  @source = options[:source]
12
12
 
13
13
  super
@@ -11,9 +11,9 @@ module Expressir
11
11
  def initialize(options = {})
12
12
  @extensible = options[:extensible]
13
13
  @generic_entity = options[:generic_entity]
14
- @items = options.fetch(:items, [])
14
+ @items = options[:items] || []
15
15
  @extension_type = options[:extension_type]
16
- @extension_items = options.fetch(:extension_items, [])
16
+ @extension_items = options[:extension_items] || []
17
17
 
18
18
  super
19
19
  end
@@ -7,11 +7,11 @@ module Expressir
7
7
 
8
8
  def initialize(options = {})
9
9
  @id = options[:id]
10
- @remarks = options.fetch(:remarks, [])
11
- @remark_items = options.fetch(:remark_items, [])
10
+ @remarks = options[:remarks] || []
11
+ @remark_items = options[:remark_items] || []
12
12
  @source = options[:source]
13
13
 
14
- @attributes = options.fetch(:attributes, [])
14
+ @attributes = options[:attributes] || []
15
15
 
16
16
  super
17
17
  end
@@ -8,8 +8,8 @@ module Expressir
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
- @remarks = options.fetch(:remarks, [])
12
- @remark_items = options.fetch(:remark_items, [])
11
+ @remarks = options[:remarks] || []
12
+ @remark_items = options[:remark_items] || []
13
13
  @source = options[:source]
14
14
 
15
15
  @type = options[:type]
@@ -7,8 +7,8 @@ module Expressir
7
7
 
8
8
  def initialize(options = {})
9
9
  @id = options[:id]
10
- @remarks = options.fetch(:remarks, [])
11
- @remark_items = options.fetch(:remark_items, [])
10
+ @remarks = options[:remarks] || []
11
+ @remark_items = options[:remark_items] || []
12
12
  @source = options[:source]
13
13
 
14
14
  @expression = options[:expression]
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "0.2.26".freeze
2
+ VERSION = "0.2.27".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- SCHEMA single_schema;
1
+ SCHEMA single_schema 'version';
2
2
  ENTITY empty_entity; END_ENTITY;
3
3
  ENTITY subtype_empty_entity SUBTYPE OF (empty_entity); END_ENTITY;
4
4
  END_SCHEMA;
@@ -4,6 +4,9 @@ schemas:
4
4
  - _class: Expressir::Model::Schema
5
5
  file: original/examples/syntax/single.exp
6
6
  id: single_schema
7
+ version:
8
+ _class: Expressir::Model::SchemaVersion
9
+ value: version
7
10
  entities:
8
11
  - _class: Expressir::Model::Entity
9
12
  id: empty_entity
@@ -1,4 +1,4 @@
1
- SCHEMA single_schema;
1
+ SCHEMA single_schema 'version';
2
2
 
3
3
  ENTITY empty_entity;
4
4
  END_ENTITY;
@@ -4,6 +4,9 @@ schemas:
4
4
  - _class: Expressir::Model::Schema
5
5
  file: original/examples/syntax/single.exp
6
6
  id: single_schema
7
+ version:
8
+ _class: Expressir::Model::SchemaVersion
9
+ value: version
7
10
  entities:
8
11
  - _class: Expressir::Model::Entity
9
12
  id: empty_entity
@@ -21,7 +24,7 @@ schemas:
21
24
  SUBTYPE OF (empty_entity);
22
25
  END_ENTITY;
23
26
  source: |-
24
- SCHEMA single_schema;
27
+ SCHEMA single_schema 'version';
25
28
 
26
29
  ENTITY empty_entity;
27
30
  END_ENTITY;
@@ -1,5 +1,5 @@
1
1
  -- schema
2
- SCHEMA syntax_schema 'version';
2
+ SCHEMA syntax_schema '{ISO standard 10303 part(41) object(1) version(8)}';
3
3
 
4
4
  -- interfaces
5
5
  USE FROM contract_schema;
@@ -5,8 +5,24 @@ schemas:
5
5
  file: original/examples/syntax/syntax.exp
6
6
  id: syntax_schema
7
7
  version:
8
- _class: Expressir::Model::Literals::String
9
- value: version
8
+ _class: Expressir::Model::SchemaVersion
9
+ value: "{ISO standard 10303 part(41) object(1) version(8)}"
10
+ items:
11
+ - _class: Expressir::Model::SchemaVersionItem
12
+ name: ISO
13
+ - _class: Expressir::Model::SchemaVersionItem
14
+ name: standard
15
+ - _class: Expressir::Model::SchemaVersionItem
16
+ value: '10303'
17
+ - _class: Expressir::Model::SchemaVersionItem
18
+ name: part
19
+ value: '41'
20
+ - _class: Expressir::Model::SchemaVersionItem
21
+ name: object
22
+ value: '1'
23
+ - _class: Expressir::Model::SchemaVersionItem
24
+ name: version
25
+ value: '8'
10
26
  interfaces:
11
27
  - _class: Expressir::Model::Interface
12
28
  kind: :USE
@@ -1,4 +1,4 @@
1
- SCHEMA syntax_schema 'version';
1
+ SCHEMA syntax_schema '{ISO standard 10303 part(41) object(1) version(8)}';
2
2
 
3
3
  USE FROM contract_schema;
4
4
  USE FROM contract_schema
@@ -1,4 +1,4 @@
1
- SCHEMA syntax_schema 'version';
1
+ SCHEMA syntax_schema '{ISO standard 10303 part(41) object(1) version(8)}';
2
2
 
3
3
  USE FROM contract_schema;
4
4
  USE FROM contract_schema
@@ -1,4 +1,4 @@
1
- SCHEMA syntax_schema 'version';
1
+ SCHEMA syntax_schema '{ISO standard 10303 part(41) object(1) version(8)}';
2
2
 
3
3
  USE FROM contract_schema;
4
4
  USE FROM contract_schema
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.26
4
+ version: 0.2.27
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -260,6 +260,8 @@ files:
260
260
  - lib/expressir/model/repository.rb
261
261
  - lib/expressir/model/rule.rb
262
262
  - lib/expressir/model/schema.rb
263
+ - lib/expressir/model/schema_version.rb
264
+ - lib/expressir/model/schema_version_item.rb
263
265
  - lib/expressir/model/statements/alias.rb
264
266
  - lib/expressir/model/statements/assignment.rb
265
267
  - lib/expressir/model/statements/call.rb