expressir 0.2.21-arm64-darwin → 0.2.24-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +22 -6
  3. data/lib/expressir/express_exp/2.4/express_parser.bundle +0 -0
  4. data/lib/expressir/express_exp/2.5/express_parser.bundle +0 -0
  5. data/lib/expressir/express_exp/2.6/express_parser.bundle +0 -0
  6. data/lib/expressir/express_exp/2.7/express_parser.bundle +0 -0
  7. data/lib/expressir/express_exp/3.0/express_parser.bundle +0 -0
  8. data/lib/expressir/express_exp/cache.rb +1 -1
  9. data/lib/expressir/express_exp/visitor.rb +19 -18
  10. data/lib/expressir/model.rb +1 -1
  11. data/lib/expressir/model/attribute.rb +12 -5
  12. data/lib/expressir/model/cache.rb +2 -2
  13. data/lib/expressir/model/constant.rb +9 -2
  14. data/lib/expressir/model/entity.rb +10 -8
  15. data/lib/expressir/model/enumeration_item.rb +7 -0
  16. data/lib/expressir/model/expressions/aggregate_initializer.rb +1 -1
  17. data/lib/expressir/model/expressions/aggregate_item.rb +2 -2
  18. data/lib/expressir/model/expressions/attribute_reference.rb +2 -2
  19. data/lib/expressir/model/expressions/binary_expression.rb +3 -3
  20. data/lib/expressir/model/expressions/call.rb +2 -2
  21. data/lib/expressir/model/expressions/entity_constructor.rb +2 -2
  22. data/lib/expressir/model/expressions/group_reference.rb +2 -2
  23. data/lib/expressir/model/expressions/index_reference.rb +3 -3
  24. data/lib/expressir/model/expressions/interval.rb +5 -5
  25. data/lib/expressir/model/expressions/query_expression.rb +5 -3
  26. data/lib/expressir/model/expressions/simple_reference.rb +1 -1
  27. data/lib/expressir/model/expressions/unary_expression.rb +2 -2
  28. data/lib/expressir/model/function.rb +13 -11
  29. data/lib/expressir/model/identifier.rb +6 -3
  30. data/lib/expressir/model/interface.rb +3 -3
  31. data/lib/expressir/model/interface_item.rb +2 -2
  32. data/lib/expressir/model/interfaced_item.rb +11 -6
  33. data/lib/expressir/model/literals/binary.rb +1 -1
  34. data/lib/expressir/model/literals/integer.rb +1 -1
  35. data/lib/expressir/model/literals/logical.rb +1 -1
  36. data/lib/expressir/model/literals/real.rb +1 -1
  37. data/lib/expressir/model/literals/string.rb +2 -2
  38. data/lib/expressir/model/model_element.rb +29 -24
  39. data/lib/expressir/model/parameter.rb +9 -2
  40. data/lib/expressir/model/procedure.rb +12 -10
  41. data/lib/expressir/model/{informal_proposition.rb → remark_item.rb} +3 -6
  42. data/lib/expressir/model/repository.rb +1 -1
  43. data/lib/expressir/model/rule.rb +14 -12
  44. data/lib/expressir/model/schema.rb +13 -11
  45. data/lib/expressir/model/statements/alias.rb +5 -3
  46. data/lib/expressir/model/statements/assignment.rb +2 -2
  47. data/lib/expressir/model/statements/call.rb +2 -2
  48. data/lib/expressir/model/statements/case.rb +3 -3
  49. data/lib/expressir/model/statements/case_action.rb +2 -2
  50. data/lib/expressir/model/statements/compound.rb +1 -1
  51. data/lib/expressir/model/statements/if.rb +3 -3
  52. data/lib/expressir/model/statements/repeat.rb +9 -7
  53. data/lib/expressir/model/statements/return.rb +1 -1
  54. data/lib/expressir/model/subtype_constraint.rb +11 -4
  55. data/lib/expressir/model/type.rb +6 -4
  56. data/lib/expressir/model/types/aggregate.rb +8 -1
  57. data/lib/expressir/model/types/array.rb +5 -5
  58. data/lib/expressir/model/types/bag.rb +3 -3
  59. data/lib/expressir/model/types/binary.rb +2 -2
  60. data/lib/expressir/model/types/enumeration.rb +4 -4
  61. data/lib/expressir/model/types/generic.rb +7 -0
  62. data/lib/expressir/model/types/generic_entity.rb +7 -0
  63. data/lib/expressir/model/types/list.rb +4 -4
  64. data/lib/expressir/model/types/real.rb +1 -1
  65. data/lib/expressir/model/types/select.rb +5 -5
  66. data/lib/expressir/model/types/set.rb +3 -3
  67. data/lib/expressir/model/types/string.rb +2 -2
  68. data/lib/expressir/model/unique.rb +8 -1
  69. data/lib/expressir/model/variable.rb +9 -2
  70. data/lib/expressir/model/where.rb +8 -1
  71. data/lib/expressir/version.rb +1 -1
  72. data/original/examples/syntax/remark.exp +12 -10
  73. data/original/examples/syntax/remark.yaml +9 -3
  74. data/original/examples/syntax/remark_formatted.exp +3 -1
  75. data/spec/expressir/model/model_element_spec.rb +20 -20
  76. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37e0708a5e57cb5f7f4c1b45af5fbf6f191618576653a3279739237fe82b492f
4
- data.tar.gz: 9356a6e34273883e7e1daf97fc03e4764c9799018e51d2dd4bf19ade02869564
3
+ metadata.gz: c54f25073ecc7278ea37324e1477cff4da9c26b9c3a10232fd46ce56a5249d06
4
+ data.tar.gz: 2e1608be278b9e437c25e03de624a83ee4a1f6f3f0eb97dbccb2cff97fe6e9a0
5
5
  SHA512:
6
- metadata.gz: 4c02566bad733b3a700e5f72186a23a47bbe523303e5b3e8fc586eeff0aa7e925b053f03f3a68de84d0a7e2caa23b241a59052ec484943d6632e3d1f3fc648af
7
- data.tar.gz: 8e513c9053ac3a1f2295c4e0a978115052e0462421753e7966cbed6995991844875054faf52c235bd4c475998dbec09a919acc92ae6ac299b5aea1e98a4f3b9c
6
+ metadata.gz: f1f2f68a36cb6570af3a9dbb05ddbd0ff9569b67dceb5f6caa1144338fff16fa08d8ef25f3858f8056bc6236ca17002a1c4c379b7b1776f9a7954eb14c91ab18
7
+ data.tar.gz: ea2c69c479755d193a420e6a8d54aacf4627ef90f4bd1bd17b71ecbc3fef8d02dcf53003edb78167f85a745f0a447aff02c35b3dac2e180b90bde46205c3c1fc
@@ -12,8 +12,27 @@ on:
12
12
  tags: [ v* ]
13
13
 
14
14
  jobs:
15
+ bump:
16
+ runs-on: ubuntu-18.04
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ with:
20
+ submodules: recursive
21
+
22
+ - uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: '2.6'
25
+
26
+ - if: ${{ github.event_name == 'workflow_dispatch' }} # unfortunatelly cannot keep this condition on job level
27
+ run: |
28
+ git config user.name github-actions
29
+ git config user.email github-actions@github.com
30
+ gem install gem-release
31
+ gem bump --version ${{ github.event.inputs.next_version }} --tag --push
32
+
15
33
  pack:
16
34
  runs-on: ubuntu-18.04
35
+ needs: bump
17
36
  strategy:
18
37
  fail-fast: false
19
38
  matrix:
@@ -26,13 +45,10 @@ jobs:
26
45
  - uses: ruby/setup-ruby@v1
27
46
  with:
28
47
  ruby-version: '2.6'
29
- bundler-cache: true
48
+ # bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
49
+ # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
30
50
 
31
- - if: ${{ github.event_name == 'workflow_dispatch' }}
32
- run: |
33
- git config user.name github-actions
34
- git config user.email github-actions@github.com
35
- gem bump --version ${{ github.event.inputs.next_version }} --tag --push
51
+ - run: bundle install --jobs 4 --retry 3
36
52
 
37
53
  # build gem WITHOUT pre-built native extension
38
54
  - run: gem build expressir.gemspec
@@ -35,7 +35,7 @@ module Expressir
35
35
  cache = Model::ModelElement.from_hash(hash, root_path: root_path)
36
36
 
37
37
  if cache.version != version
38
- raise CacheLoadError.new("Cache version mismatch, cache version is #{cache.version}, Expressir version is #{VERSION}")
38
+ raise CacheLoadError.new("Cache version mismatch, cache version is #{cache.version}, Expressir version is #{version}")
39
39
  end
40
40
 
41
41
  cache.content
@@ -107,27 +107,28 @@ module Expressir
107
107
  target_node = node.find(path)
108
108
  return target_node if target_node
109
109
 
110
- # check if path should create implicit informal proposal
111
- # see https://github.com/lutaml/expressir/issues/50
110
+ # check if path can create implicit remark item
111
+ # see https://github.com/lutaml/expressir/issues/78
112
112
  rest, _, current_path = path.rpartition(".") # get last path part
113
113
  _, _, current_path = current_path.rpartition(":") # ignore prefix
114
+ parent_node = node.find(rest)
115
+ if parent_node and parent_node.class.method_defined? :remark_items
116
+ remark_item = Model::RemarkItem.new({
117
+ id: current_path
118
+ })
119
+ remark_item.parent = parent_node
114
120
 
115
- # match informal proposition id
116
- informal_proposition_id = current_path.match(/^IP\d+$/).to_a[0]
117
- return unless informal_proposition_id
118
-
119
- # find informal proposition target
120
- target_node = node.find(rest)
121
- return unless target_node and target_node.class.method_defined? :informal_propositions
122
-
123
- # create implicit informal proposition
124
- informal_proposition = Model::InformalProposition.new({
125
- id: informal_proposition_id
126
- })
127
- target_node.informal_propositions << informal_proposition
128
- target_node.reset_children_by_id
129
- informal_proposition.parent = target_node
130
- informal_proposition
121
+ # check if path can create implicit informal proposition
122
+ # see https://github.com/lutaml/expressir/issues/50
123
+ if parent_node.class.method_defined? :informal_propositions and current_path.match(/^IP\d+$/)
124
+ parent_node.informal_propositions << remark_item
125
+ else
126
+ parent_node.remark_items << remark_item
127
+ end
128
+ parent_node.reset_children_by_id
129
+
130
+ remark_item
131
+ end
131
132
  end
132
133
 
133
134
  def attach_remarks(ctx, node)
@@ -9,12 +9,12 @@ require 'expressir/model/constant'
9
9
  require 'expressir/model/entity'
10
10
  require 'expressir/model/enumeration_item'
11
11
  require 'expressir/model/function'
12
- require 'expressir/model/informal_proposition'
13
12
  require 'expressir/model/interface'
14
13
  require 'expressir/model/interface_item'
15
14
  require 'expressir/model/interfaced_item'
16
15
  require 'expressir/model/parameter'
17
16
  require 'expressir/model/procedure'
17
+ require 'expressir/model/remark_item'
18
18
  require 'expressir/model/repository'
19
19
  require 'expressir/model/rule'
20
20
  require 'expressir/model/schema'
@@ -7,15 +7,16 @@ module Expressir
7
7
  DERIVED = :DERIVED
8
8
  INVERSE = :INVERSE
9
9
 
10
- attr_accessor :kind
11
- attr_accessor :supertype_attribute
12
- attr_accessor :optional
13
- attr_accessor :type
14
- attr_accessor :expression
10
+ model_attr_accessor :kind
11
+ model_attr_accessor :supertype_attribute
12
+ model_attr_accessor :optional
13
+ model_attr_accessor :type
14
+ model_attr_accessor :expression
15
15
 
16
16
  def initialize(options = {})
17
17
  @id = options[:id]
18
18
  @remarks = options.fetch(:remarks, [])
19
+ @remark_items = options.fetch(:remark_items, [])
19
20
  @source = options[:source]
20
21
 
21
22
  @kind = options[:kind]
@@ -26,6 +27,12 @@ module Expressir
26
27
 
27
28
  super
28
29
  end
30
+
31
+ def children
32
+ [
33
+ *remark_items
34
+ ]
35
+ end
29
36
  end
30
37
  end
31
38
  end
@@ -1,8 +1,8 @@
1
1
  module Expressir
2
2
  module Model
3
3
  class Cache < ModelElement
4
- attr_accessor :version
5
- attr_accessor :content
4
+ model_attr_accessor :version
5
+ model_attr_accessor :content
6
6
 
7
7
  def initialize(options = {})
8
8
  @version = options[:version]
@@ -3,12 +3,13 @@ module Expressir
3
3
  class Constant < ModelElement
4
4
  include Identifier
5
5
 
6
- attr_accessor :type
7
- attr_accessor :expression
6
+ model_attr_accessor :type
7
+ model_attr_accessor :expression
8
8
 
9
9
  def initialize(options = {})
10
10
  @id = options[:id]
11
11
  @remarks = options.fetch(:remarks, [])
12
+ @remark_items = options.fetch(:remark_items, [])
12
13
  @source = options[:source]
13
14
 
14
15
  @type = options[:type]
@@ -16,6 +17,12 @@ module Expressir
16
17
 
17
18
  super
18
19
  end
20
+
21
+ def children
22
+ [
23
+ *remark_items
24
+ ]
25
+ end
19
26
  end
20
27
  end
21
28
  end
@@ -3,17 +3,18 @@ module Expressir
3
3
  class Entity < ModelElement
4
4
  include Identifier
5
5
 
6
- attr_accessor :abstract
7
- attr_accessor :supertype_expression
8
- attr_accessor :subtype_of
9
- attr_accessor :attributes
10
- attr_accessor :unique
11
- attr_accessor :where
12
- attr_accessor :informal_propositions
6
+ model_attr_accessor :abstract
7
+ model_attr_accessor :supertype_expression
8
+ model_attr_accessor :subtype_of
9
+ model_attr_accessor :attributes
10
+ model_attr_accessor :unique
11
+ model_attr_accessor :where
12
+ model_attr_accessor :informal_propositions
13
13
 
14
14
  def initialize(options = {})
15
15
  @id = options[:id]
16
16
  @remarks = options.fetch(:remarks, [])
17
+ @remark_items = options.fetch(:remark_items, [])
17
18
  @source = options[:source]
18
19
 
19
20
  @abstract = options[:abstract]
@@ -32,7 +33,8 @@ module Expressir
32
33
  *attributes,
33
34
  *unique,
34
35
  *where,
35
- *informal_propositions
36
+ *informal_propositions,
37
+ *remark_items
36
38
  ]
37
39
  end
38
40
  end
@@ -6,10 +6,17 @@ module Expressir
6
6
  def initialize(options = {})
7
7
  @id = options[:id]
8
8
  @remarks = options.fetch(:remarks, [])
9
+ @remark_items = options.fetch(:remark_items, [])
9
10
  @source = options[:source]
10
11
 
11
12
  super
12
13
  end
14
+
15
+ def children
16
+ [
17
+ *remark_items
18
+ ]
19
+ end
13
20
  end
14
21
  end
15
22
  end
@@ -2,7 +2,7 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class AggregateInitializer < ModelElement
5
- attr_accessor :items
5
+ model_attr_accessor :items
6
6
 
7
7
  def initialize(options = {})
8
8
  @items = options.fetch(:items, [])
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class AggregateItem < ModelElement
5
- attr_accessor :expression
6
- attr_accessor :repetition
5
+ model_attr_accessor :expression
6
+ model_attr_accessor :repetition
7
7
 
8
8
  def initialize(options = {})
9
9
  @expression = options[:expression]
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class AttributeReference < ModelElement
5
- attr_accessor :ref
6
- attr_accessor :attribute
5
+ model_attr_accessor :ref
6
+ model_attr_accessor :attribute
7
7
 
8
8
  def initialize(options = {})
9
9
  @ref = options[:ref]
@@ -25,9 +25,9 @@ module Expressir
25
25
  SUBTRACTION = :SUBTRACTION
26
26
  XOR = :XOR
27
27
 
28
- attr_accessor :operator
29
- attr_accessor :operand1
30
- attr_accessor :operand2
28
+ model_attr_accessor :operator
29
+ model_attr_accessor :operand1
30
+ model_attr_accessor :operand2
31
31
 
32
32
  def initialize(options = {})
33
33
  @operator = options[:operator]
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class Call < ModelElement
5
- attr_accessor :ref
6
- attr_accessor :parameters
5
+ model_attr_accessor :ref
6
+ model_attr_accessor :parameters
7
7
 
8
8
  def initialize(options = {})
9
9
  @ref = options[:ref]
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class EntityConstructor < ModelElement
5
- attr_accessor :entity
6
- attr_accessor :parameters
5
+ model_attr_accessor :entity
6
+ model_attr_accessor :parameters
7
7
 
8
8
  def initialize(options = {})
9
9
  @entity = options[:entity]
@@ -2,8 +2,8 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class GroupReference < ModelElement
5
- attr_accessor :ref
6
- attr_accessor :entity
5
+ model_attr_accessor :ref
6
+ model_attr_accessor :entity
7
7
 
8
8
  def initialize(options = {})
9
9
  @ref = options[:ref]
@@ -2,9 +2,9 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class IndexReference < ModelElement
5
- attr_accessor :ref
6
- attr_accessor :index1
7
- attr_accessor :index2
5
+ model_attr_accessor :ref
6
+ model_attr_accessor :index1
7
+ model_attr_accessor :index2
8
8
 
9
9
  def initialize(options = {})
10
10
  @ref = options[:ref]
@@ -2,11 +2,11 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class Interval < ModelElement
5
- attr_accessor :low
6
- attr_accessor :operator1
7
- attr_accessor :item
8
- attr_accessor :operator2
9
- attr_accessor :high
5
+ model_attr_accessor :low
6
+ model_attr_accessor :operator1
7
+ model_attr_accessor :item
8
+ model_attr_accessor :operator2
9
+ model_attr_accessor :high
10
10
 
11
11
  def initialize(options = {})
12
12
  @low = options[:low]
@@ -4,12 +4,13 @@ module Expressir
4
4
  class QueryExpression < ModelElement
5
5
  include Identifier
6
6
 
7
- attr_accessor :aggregate_source
8
- attr_accessor :expression
7
+ model_attr_accessor :aggregate_source
8
+ model_attr_accessor :expression
9
9
 
10
10
  def initialize(options = {})
11
11
  @id = options[:id]
12
12
  @remarks = options.fetch(:remarks, [])
13
+ @remark_items = options.fetch(:remark_items, [])
13
14
  @source = options[:source]
14
15
 
15
16
  @aggregate_source = options[:aggregate_source]
@@ -20,7 +21,8 @@ module Expressir
20
21
 
21
22
  def children
22
23
  [
23
- self
24
+ self,
25
+ *remark_items
24
26
  ]
25
27
  end
26
28
  end
@@ -2,7 +2,7 @@ module Expressir
2
2
  module Model
3
3
  module Expressions
4
4
  class SimpleReference < ModelElement
5
- attr_accessor :id
5
+ model_attr_accessor :id
6
6
 
7
7
  def initialize(options = {})
8
8
  @id = options[:id]
@@ -6,8 +6,8 @@ module Expressir
6
6
  NOT = :NOT
7
7
  PLUS = :PLUS
8
8
 
9
- attr_accessor :operator
10
- attr_accessor :operand
9
+ model_attr_accessor :operator
10
+ model_attr_accessor :operand
11
11
 
12
12
  def initialize(options = {})
13
13
  @operator = options[:operator]
@@ -3,20 +3,21 @@ module Expressir
3
3
  class Function < ModelElement
4
4
  include Identifier
5
5
 
6
- attr_accessor :parameters
7
- attr_accessor :return_type
8
- attr_accessor :types
9
- attr_accessor :entities
10
- attr_accessor :subtype_constraints
11
- attr_accessor :functions
12
- attr_accessor :procedures
13
- attr_accessor :constants
14
- attr_accessor :variables
15
- attr_accessor :statements
6
+ model_attr_accessor :parameters
7
+ model_attr_accessor :return_type
8
+ model_attr_accessor :types
9
+ model_attr_accessor :entities
10
+ model_attr_accessor :subtype_constraints
11
+ model_attr_accessor :functions
12
+ model_attr_accessor :procedures
13
+ model_attr_accessor :constants
14
+ model_attr_accessor :variables
15
+ model_attr_accessor :statements
16
16
 
17
17
  def initialize(options = {})
18
18
  @id = options[:id]
19
19
  @remarks = options.fetch(:remarks, [])
20
+ @remark_items = options.fetch(:remark_items, [])
20
21
  @source = options[:source]
21
22
 
22
23
  @parameters = options.fetch(:parameters, [])
@@ -47,7 +48,8 @@ module Expressir
47
48
  *functions,
48
49
  *procedures,
49
50
  *constants,
50
- *variables
51
+ *variables,
52
+ *remark_items
51
53
  ]
52
54
  end
53
55
  end