expressir 0.2.7-x64-mingw32 → 0.2.12-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +3 -4
  3. data/.gitignore +1 -1
  4. data/exe/format +16 -0
  5. data/expressir.gemspec +3 -2
  6. data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
  7. data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
  8. data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
  9. data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
  10. data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
  11. data/lib/expressir/express_exp/formatter.rb +147 -110
  12. data/lib/expressir/express_exp/hyperlink_formatter.rb +25 -0
  13. data/lib/expressir/express_exp/parser.rb +14 -1
  14. data/lib/expressir/express_exp/schema_head_formatter.rb +14 -0
  15. data/lib/expressir/express_exp/visitor.rb +206 -118
  16. data/lib/expressir/model.rb +3 -1
  17. data/lib/expressir/model/attribute.rb +5 -1
  18. data/lib/expressir/model/constant.rb +5 -1
  19. data/lib/expressir/model/entity.rb +14 -20
  20. data/lib/expressir/model/enumeration_item.rb +5 -1
  21. data/lib/expressir/model/expressions/aggregate_initializer.rb +4 -2
  22. data/lib/expressir/model/expressions/aggregate_item.rb +3 -1
  23. data/lib/expressir/model/expressions/attribute_reference.rb +3 -1
  24. data/lib/expressir/model/expressions/binary_expression.rb +3 -1
  25. data/lib/expressir/model/expressions/call.rb +4 -2
  26. data/lib/expressir/model/expressions/entity_constructor.rb +4 -2
  27. data/lib/expressir/model/expressions/group_reference.rb +3 -1
  28. data/lib/expressir/model/expressions/index_reference.rb +3 -1
  29. data/lib/expressir/model/expressions/interval.rb +3 -1
  30. data/lib/expressir/model/expressions/query_expression.rb +5 -2
  31. data/lib/expressir/model/expressions/simple_reference.rb +3 -1
  32. data/lib/expressir/model/expressions/unary_expression.rb +3 -1
  33. data/lib/expressir/model/function.rb +28 -39
  34. data/lib/expressir/model/identifier.rb +0 -1
  35. data/lib/expressir/model/informal_proposition.rb +15 -0
  36. data/lib/expressir/model/interface.rb +4 -2
  37. data/lib/expressir/model/literals/binary.rb +3 -1
  38. data/lib/expressir/model/literals/integer.rb +3 -1
  39. data/lib/expressir/model/literals/logical.rb +3 -1
  40. data/lib/expressir/model/literals/real.rb +3 -1
  41. data/lib/expressir/model/literals/string.rb +3 -1
  42. data/lib/expressir/model/model_element.rb +140 -0
  43. data/lib/expressir/model/parameter.rb +5 -1
  44. data/lib/expressir/model/procedure.rb +29 -40
  45. data/lib/expressir/model/renamed_ref.rb +3 -1
  46. data/lib/expressir/model/repository.rb +5 -5
  47. data/lib/expressir/model/rule.rb +33 -41
  48. data/lib/expressir/model/schema.rb +32 -46
  49. data/lib/expressir/model/statements/alias.rb +6 -3
  50. data/lib/expressir/model/statements/assignment.rb +3 -1
  51. data/lib/expressir/model/statements/call.rb +4 -2
  52. data/lib/expressir/model/statements/case.rb +4 -2
  53. data/lib/expressir/model/statements/case_action.rb +4 -2
  54. data/lib/expressir/model/statements/compound.rb +4 -2
  55. data/lib/expressir/model/statements/escape.rb +1 -1
  56. data/lib/expressir/model/statements/if.rb +5 -3
  57. data/lib/expressir/model/statements/null.rb +1 -1
  58. data/lib/expressir/model/statements/repeat.rb +6 -3
  59. data/lib/expressir/model/statements/return.rb +3 -1
  60. data/lib/expressir/model/statements/skip.rb +1 -1
  61. data/lib/expressir/model/subtype_constraint.rb +5 -2
  62. data/lib/expressir/model/type.rb +11 -4
  63. data/lib/expressir/model/types/aggregate.rb +5 -1
  64. data/lib/expressir/model/types/array.rb +3 -1
  65. data/lib/expressir/model/types/bag.rb +3 -1
  66. data/lib/expressir/model/types/binary.rb +3 -1
  67. data/lib/expressir/model/types/boolean.rb +1 -1
  68. data/lib/expressir/model/types/enumeration.rb +5 -3
  69. data/lib/expressir/model/types/generic.rb +5 -1
  70. data/lib/expressir/model/types/generic_entity.rb +5 -1
  71. data/lib/expressir/model/types/integer.rb +1 -1
  72. data/lib/expressir/model/types/list.rb +3 -1
  73. data/lib/expressir/model/types/logical.rb +1 -1
  74. data/lib/expressir/model/types/number.rb +1 -1
  75. data/lib/expressir/model/types/real.rb +3 -1
  76. data/lib/expressir/model/types/select.rb +5 -3
  77. data/lib/expressir/model/types/set.rb +3 -1
  78. data/lib/expressir/model/types/string.rb +3 -1
  79. data/lib/expressir/model/unique.rb +6 -2
  80. data/lib/expressir/model/variable.rb +5 -1
  81. data/lib/expressir/model/where.rb +5 -1
  82. data/lib/expressir/version.rb +1 -1
  83. data/original/examples/syntax/hyperlink.exp +8 -0
  84. data/original/examples/syntax/hyperlink_formatted.exp +19 -0
  85. data/original/examples/syntax/remark.exp +63 -20
  86. data/original/examples/syntax/remark_formatted.exp +62 -24
  87. data/original/examples/syntax/simple.exp +3 -0
  88. data/original/examples/syntax/source.exp +16 -0
  89. data/original/examples/syntax/syntax.exp +202 -190
  90. data/original/examples/syntax/syntax_formatted.exp +370 -799
  91. data/spec/expressir/express_exp/{format_remark_spec.rb → formatter/remark_spec.rb} +2 -2
  92. data/spec/expressir/express_exp/{format_syntax_spec.rb → formatter/syntax_spec.rb} +2 -2
  93. data/spec/expressir/express_exp/hyperlink_formatter_spec.rb +24 -0
  94. data/spec/expressir/express_exp/parser/head_source_spec.rb +38 -0
  95. data/spec/expressir/express_exp/parser/multiple_spec.rb +32 -0
  96. data/spec/expressir/express_exp/{parse_remark_spec.rb → parser/remark_spec.rb} +120 -55
  97. data/spec/expressir/express_exp/parser/source_spec.rb +29 -0
  98. data/spec/expressir/express_exp/parser/syntax_spec.rb +3080 -0
  99. data/spec/expressir/express_exp/schema_head_formatter_spec.rb +36 -0
  100. data/spec/expressir/model/{find_spec.rb → model_element/find_spec.rb} +26 -8
  101. data/spec/expressir/model/model_element/hash_spec.rb +66 -0
  102. metadata +38 -11
  103. data/lib/expressir/model/scope.rb +0 -17
  104. data/spec/expressir/express_exp/ap233_spec.rb +0 -22
  105. data/spec/expressir/express_exp/parse_syntax_spec.rb +0 -3003
@@ -4,8 +4,8 @@ require "expressir/express_exp/formatter"
4
4
 
5
5
  RSpec.describe Expressir::ExpressExp::Formatter do
6
6
  describe ".format" do
7
- it "formats a file" do
8
- repo = Expressir::ExpressExp::Parser.from_exp(input_file)
7
+ it "formats remark" do
8
+ repo = Expressir::ExpressExp::Parser.from_file(input_file)
9
9
 
10
10
  result = Expressir::ExpressExp::Formatter.format(repo)
11
11
  expected_result = File.read(output_file)
@@ -4,8 +4,8 @@ require "expressir/express_exp/formatter"
4
4
 
5
5
  RSpec.describe Expressir::ExpressExp::Formatter do
6
6
  describe ".format" do
7
- it "formats a file" do
8
- repo = Expressir::ExpressExp::Parser.from_exp(input_file)
7
+ it "formats syntax" do
8
+ repo = Expressir::ExpressExp::Parser.from_file(input_file)
9
9
 
10
10
  result = Expressir::ExpressExp::Formatter.format(repo)
11
11
  expected_result = File.read(output_file)
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+ require "expressir/express_exp/parser"
3
+ require "expressir/express_exp/hyperlink_formatter"
4
+
5
+ RSpec.describe Expressir::ExpressExp::HyperlinkFormatter do
6
+ describe ".format" do
7
+ it "formats hyperlink" do
8
+ repo = Expressir::ExpressExp::Parser.from_file(input_file)
9
+
10
+ result = Expressir::ExpressExp::HyperlinkFormatter.format(repo)
11
+ expected_result = File.read(output_file)
12
+
13
+ expect(result).to eq(expected_result)
14
+ end
15
+ end
16
+
17
+ def input_file
18
+ @input_file ||= Expressir.root_path.join("original", "examples", "syntax", "hyperlink.exp")
19
+ end
20
+
21
+ def output_file
22
+ @output_file ||= Expressir.root_path.join("original", "examples", "syntax", "hyperlink_formatted.exp")
23
+ end
24
+ end
@@ -0,0 +1,38 @@
1
+ require "spec_helper"
2
+ require "expressir/express_exp/parser"
3
+
4
+ RSpec.describe Expressir::ExpressExp::Parser do
5
+ describe ".head_source" do
6
+ it "contains original head source" do
7
+ input = File.read(sample_file)
8
+ repo = Expressir::ExpressExp::Parser.from_file(sample_file)
9
+
10
+ repo.schemas[0].tap do |x|
11
+ start_index = x.source.index("SCHEMA")
12
+ stop_index = x.source.index(";") + ";".length - 1
13
+ expected_result = x.source[start_index..stop_index]
14
+ expect(x.head_source).to eq(expected_result)
15
+ end
16
+
17
+ repo.schemas[1].tap do |x|
18
+ start_index = x.source.index("SCHEMA")
19
+ stop_index = x.source.index(";") + ";".length - 1
20
+ expected_result = x.source[start_index..stop_index]
21
+ expect(x.head_source).to eq(expected_result)
22
+ end
23
+
24
+ repo.schemas[2].tap do |x|
25
+ start_index = x.source.index("SCHEMA")
26
+ stop_index = x.source.index("REFERENCE FROM contract_schema;") + "REFERENCE FROM contract_schema;".length - 1
27
+ expected_result = x.source[start_index..stop_index]
28
+ expect(x.head_source).to eq(expected_result)
29
+ end
30
+ end
31
+ end
32
+
33
+ def sample_file
34
+ @sample_file ||= Expressir.root_path.join(
35
+ "original", "examples", "syntax", "source.exp"
36
+ )
37
+ end
38
+ end
@@ -0,0 +1,32 @@
1
+ require "spec_helper"
2
+ require "expressir/express_exp/parser"
3
+
4
+ RSpec.describe Expressir::ExpressExp::Parser do
5
+ describe ".from_files" do
6
+ it "parses multiple files" do
7
+ repo = Expressir::ExpressExp::Parser.from_files(sample_files)
8
+
9
+ schemas = repo.schemas
10
+ expect(schemas.count).to eq(5)
11
+ expect(schemas[0].id).to eq("syntax_schema")
12
+ expect(schemas[1].id).to eq("remark_schema")
13
+ expect(schemas[2].id).to eq("entity_schema")
14
+ expect(schemas[3].id).to eq("version_entity_schema")
15
+ expect(schemas[4].id).to eq("version_interface_entity_schema")
16
+ end
17
+ end
18
+
19
+ def sample_files
20
+ @sample_files ||= [
21
+ Expressir.root_path.join(
22
+ "original", "examples", "syntax", "syntax.exp"
23
+ ),
24
+ Expressir.root_path.join(
25
+ "original", "examples", "syntax", "remark.exp"
26
+ ),
27
+ Expressir.root_path.join(
28
+ "original", "examples", "syntax", "source.exp"
29
+ )
30
+ ]
31
+ end
32
+ end
@@ -3,8 +3,8 @@ require "expressir/express_exp/parser"
3
3
 
4
4
  RSpec.describe Expressir::ExpressExp::Parser do
5
5
  describe ".from_file" do
6
- it "build an instance from a file" do
7
- repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
6
+ it "parses remark" do
7
+ repo = Expressir::ExpressExp::Parser.from_file(sample_file)
8
8
 
9
9
  schema = repo.schemas.first
10
10
 
@@ -18,7 +18,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
18
18
  expect(x.remarks[3]).to eq("universal scope - schema before")
19
19
  expect(x.remarks[4]).to eq("universal scope - schema")
20
20
  end
21
-
21
+
22
22
  schema.constants.first.tap do |x|
23
23
  expect(x).to be_instance_of(Expressir::Model::Constant)
24
24
  expect(x.remarks).to be_instance_of(Array)
@@ -26,7 +26,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
26
26
  expect(x.remarks[0]).to eq("schema scope - constant")
27
27
  expect(x.remarks[1]).to eq("universal scope - constant")
28
28
  end
29
-
29
+
30
30
  schema.types.first.tap do |x|
31
31
  expect(x).to be_instance_of(Expressir::Model::Type)
32
32
  expect(x.remarks).to be_instance_of(Array)
@@ -38,12 +38,38 @@ RSpec.describe Expressir::ExpressExp::Parser do
38
38
  x.type.items.first.tap do |x|
39
39
  expect(x).to be_instance_of(Expressir::Model::EnumerationItem)
40
40
  expect(x.remarks).to be_instance_of(Array)
41
- expect(x.remarks.count).to eq(2)
41
+ expect(x.remarks.count).to eq(4)
42
42
  expect(x.remarks[0]).to eq("schema scope - enumeration item")
43
- expect(x.remarks[1]).to eq("universal scope - enumeration item")
43
+ expect(x.remarks[1]).to eq("schema scope - enumeration item, on the same level as the type")
44
+ expect(x.remarks[2]).to eq("universal scope - enumeration item")
45
+ expect(x.remarks[3]).to eq("universal scope - enumeration item, on the same level as the type")
44
46
  end
45
47
  end
46
-
48
+
49
+ schema.types.first.where.first.tap do |x|
50
+ expect(x).to be_instance_of(Expressir::Model::Where)
51
+ expect(x.remarks).to be_instance_of(Array)
52
+ expect(x.remarks.count).to eq(6)
53
+ expect(x.remarks[0]).to eq("type scope - type where")
54
+ expect(x.remarks[1]).to eq("type scope - type where, with prefix")
55
+ expect(x.remarks[2]).to eq("schema scope - type where")
56
+ expect(x.remarks[3]).to eq("schema scope - type where, with prefix")
57
+ expect(x.remarks[4]).to eq("universal scope - type where")
58
+ expect(x.remarks[5]).to eq("universal scope - type where, with prefix")
59
+ end
60
+
61
+ schema.types.first.informal_propositions.first.tap do |x|
62
+ expect(x).to be_instance_of(Expressir::Model::InformalProposition)
63
+ expect(x.remarks).to be_instance_of(Array)
64
+ expect(x.remarks.count).to eq(6)
65
+ expect(x.remarks[0]).to eq("type scope - type informal proposition")
66
+ expect(x.remarks[1]).to eq("type scope - type informal proposition, with prefix")
67
+ expect(x.remarks[2]).to eq("schema scope - type informal proposition")
68
+ expect(x.remarks[3]).to eq("schema scope - type informal proposition, with prefix")
69
+ expect(x.remarks[4]).to eq("universal scope - type informal proposition")
70
+ expect(x.remarks[5]).to eq("universal scope - type informal proposition, with prefix")
71
+ end
72
+
47
73
  schema.entities.first.tap do |x|
48
74
  expect(x).to be_instance_of(Expressir::Model::Entity)
49
75
  expect(x.remarks).to be_instance_of(Array)
@@ -51,8 +77,8 @@ RSpec.describe Expressir::ExpressExp::Parser do
51
77
  expect(x.remarks[0]).to eq("schema scope - entity")
52
78
  expect(x.remarks[1]).to eq("universal scope - entity")
53
79
  end
54
-
55
- schema.entities.first.explicit_attributes.first.tap do |x|
80
+
81
+ schema.entities.first.attributes.find{|x| x.kind == Expressir::Model::Attribute::EXPLICIT}.tap do |x|
56
82
  expect(x).to be_instance_of(Expressir::Model::Attribute)
57
83
  expect(x.kind).to eq(Expressir::Model::Attribute::EXPLICIT)
58
84
  expect(x.remarks).to be_instance_of(Array)
@@ -61,8 +87,8 @@ RSpec.describe Expressir::ExpressExp::Parser do
61
87
  expect(x.remarks[1]).to eq("schema scope - entity attribute")
62
88
  expect(x.remarks[2]).to eq("universal scope - entity attribute")
63
89
  end
64
-
65
- schema.entities.first.derived_attributes.first.tap do |x|
90
+
91
+ schema.entities.first.attributes.find{|x| x.kind == Expressir::Model::Attribute::DERIVED}.tap do |x|
66
92
  expect(x).to be_instance_of(Expressir::Model::Attribute)
67
93
  expect(x.kind).to eq(Expressir::Model::Attribute::DERIVED)
68
94
  expect(x.remarks).to be_instance_of(Array)
@@ -71,8 +97,8 @@ RSpec.describe Expressir::ExpressExp::Parser do
71
97
  expect(x.remarks[1]).to eq("schema scope - entity derived attribute")
72
98
  expect(x.remarks[2]).to eq("universal scope - entity derived attribute")
73
99
  end
74
-
75
- schema.entities.first.inverse_attributes.first.tap do |x|
100
+
101
+ schema.entities.first.attributes.find{|x| x.kind == Expressir::Model::Attribute::INVERSE}.tap do |x|
76
102
  expect(x).to be_instance_of(Expressir::Model::Attribute)
77
103
  expect(x.kind).to eq(Expressir::Model::Attribute::INVERSE)
78
104
  expect(x.remarks).to be_instance_of(Array)
@@ -81,7 +107,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
81
107
  expect(x.remarks[1]).to eq("schema scope - entity inverse attribute")
82
108
  expect(x.remarks[2]).to eq("universal scope - entity inverse attribute")
83
109
  end
84
-
110
+
85
111
  schema.entities.first.unique.first.tap do |x|
86
112
  expect(x).to be_instance_of(Expressir::Model::Unique)
87
113
  expect(x.remarks).to be_instance_of(Array)
@@ -90,16 +116,31 @@ RSpec.describe Expressir::ExpressExp::Parser do
90
116
  expect(x.remarks[1]).to eq("schema scope - entity unique")
91
117
  expect(x.remarks[2]).to eq("universal scope - entity unique")
92
118
  end
93
-
119
+
94
120
  schema.entities.first.where.first.tap do |x|
95
121
  expect(x).to be_instance_of(Expressir::Model::Where)
96
122
  expect(x.remarks).to be_instance_of(Array)
97
- expect(x.remarks.count).to eq(3)
123
+ expect(x.remarks.count).to eq(6)
98
124
  expect(x.remarks[0]).to eq("entity scope - entity where")
99
- expect(x.remarks[1]).to eq("schema scope - entity where")
100
- expect(x.remarks[2]).to eq("universal scope - entity where")
125
+ expect(x.remarks[1]).to eq("entity scope - entity where, with prefix")
126
+ expect(x.remarks[2]).to eq("schema scope - entity where")
127
+ expect(x.remarks[3]).to eq("schema scope - entity where, with prefix")
128
+ expect(x.remarks[4]).to eq("universal scope - entity where")
129
+ expect(x.remarks[5]).to eq("universal scope - entity where, with prefix")
130
+ end
131
+
132
+ schema.entities.first.informal_propositions.first.tap do |x|
133
+ expect(x).to be_instance_of(Expressir::Model::InformalProposition)
134
+ expect(x.remarks).to be_instance_of(Array)
135
+ expect(x.remarks.count).to eq(6)
136
+ expect(x.remarks[0]).to eq("entity scope - entity informal proposition")
137
+ expect(x.remarks[1]).to eq("entity scope - entity informal proposition, with prefix")
138
+ expect(x.remarks[2]).to eq("schema scope - entity informal proposition")
139
+ expect(x.remarks[3]).to eq("schema scope - entity informal proposition, with prefix")
140
+ expect(x.remarks[4]).to eq("universal scope - entity informal proposition")
141
+ expect(x.remarks[5]).to eq("universal scope - entity informal proposition, with prefix")
101
142
  end
102
-
143
+
103
144
  schema.subtype_constraints.first.tap do |x|
104
145
  expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
105
146
  expect(x.remarks).to be_instance_of(Array)
@@ -107,7 +148,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
107
148
  expect(x.remarks[0]).to eq("schema scope - subtype constraint")
108
149
  expect(x.remarks[1]).to eq("universal scope - subtype constraint")
109
150
  end
110
-
151
+
111
152
  schema.functions.first.tap do |x|
112
153
  expect(x).to be_instance_of(Expressir::Model::Function)
113
154
  expect(x.remarks).to be_instance_of(Array)
@@ -115,7 +156,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
115
156
  expect(x.remarks[0]).to eq("schema scope - function")
116
157
  expect(x.remarks[1]).to eq("universal scope - function")
117
158
  end
118
-
159
+
119
160
  schema.functions.first.parameters.first.tap do |x|
120
161
  expect(x).to be_instance_of(Expressir::Model::Parameter)
121
162
  expect(x.remarks).to be_instance_of(Array)
@@ -124,7 +165,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
124
165
  expect(x.remarks[1]).to eq("schema scope - function parameter")
125
166
  expect(x.remarks[2]).to eq("universal scope - function parameter")
126
167
  end
127
-
168
+
128
169
  schema.functions.first.types.first.tap do |x|
129
170
  expect(x).to be_instance_of(Expressir::Model::Type)
130
171
  expect(x.remarks).to be_instance_of(Array)
@@ -137,13 +178,16 @@ RSpec.describe Expressir::ExpressExp::Parser do
137
178
  x.type.items.first.tap do |x|
138
179
  expect(x).to be_instance_of(Expressir::Model::EnumerationItem)
139
180
  expect(x.remarks).to be_instance_of(Array)
140
- expect(x.remarks.count).to eq(3)
181
+ expect(x.remarks.count).to eq(6)
141
182
  expect(x.remarks[0]).to eq("function scope - function enumeration item")
142
- expect(x.remarks[1]).to eq("schema scope - function enumeration item")
143
- expect(x.remarks[2]).to eq("universal scope - function enumeration item")
183
+ expect(x.remarks[1]).to eq("function scope - function enumeration item, on the same level as the type")
184
+ expect(x.remarks[2]).to eq("schema scope - function enumeration item")
185
+ expect(x.remarks[3]).to eq("schema scope - function enumeration item, on the same level as the type")
186
+ expect(x.remarks[4]).to eq("universal scope - function enumeration item")
187
+ expect(x.remarks[5]).to eq("universal scope - function enumeration item, on the same level as the type")
144
188
  end
145
189
  end
146
-
190
+
147
191
  schema.functions.first.constants.first.tap do |x|
148
192
  expect(x).to be_instance_of(Expressir::Model::Constant)
149
193
  expect(x.remarks).to be_instance_of(Array)
@@ -152,7 +196,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
152
196
  expect(x.remarks[1]).to eq("schema scope - function constant")
153
197
  expect(x.remarks[2]).to eq("universal scope - function constant")
154
198
  end
155
-
199
+
156
200
  schema.functions.first.variables.first.tap do |x|
157
201
  expect(x).to be_instance_of(Expressir::Model::Variable)
158
202
  expect(x.remarks).to be_instance_of(Array)
@@ -161,21 +205,21 @@ RSpec.describe Expressir::ExpressExp::Parser do
161
205
  expect(x.remarks[1]).to eq("schema scope - function variable")
162
206
  expect(x.remarks[2]).to eq("universal scope - function variable")
163
207
  end
164
-
208
+
165
209
  schema.functions.first.statements[0].tap do |x|
166
210
  expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
167
211
  expect(x.remarks).to be_instance_of(Array)
168
212
  expect(x.remarks.count).to eq(1)
169
213
  expect(x.remarks[0]).to eq("function alias scope - function alias")
170
214
  end
171
-
215
+
172
216
  schema.functions.first.statements[1].tap do |x|
173
217
  expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
174
218
  expect(x.remarks).to be_instance_of(Array)
175
219
  expect(x.remarks.count).to eq(1)
176
220
  expect(x.remarks[0]).to eq("function repeat scope - function repeat")
177
221
  end
178
-
222
+
179
223
  schema.functions.first.statements[2].tap do |x|
180
224
  expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
181
225
  expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QueryExpression)
@@ -183,7 +227,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
183
227
  expect(x.expression.remarks.count).to eq(1)
184
228
  expect(x.expression.remarks[0]).to eq("function query scope - function query")
185
229
  end
186
-
230
+
187
231
  schema.procedures.first.tap do |x|
188
232
  expect(x).to be_instance_of(Expressir::Model::Procedure)
189
233
  expect(x.remarks).to be_instance_of(Array)
@@ -191,7 +235,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
191
235
  expect(x.remarks[0]).to eq("schema scope - procedure")
192
236
  expect(x.remarks[1]).to eq("universal scope - procedure")
193
237
  end
194
-
238
+
195
239
  schema.procedures.first.parameters.first.tap do |x|
196
240
  expect(x).to be_instance_of(Expressir::Model::Parameter)
197
241
  expect(x.remarks).to be_instance_of(Array)
@@ -200,7 +244,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
200
244
  expect(x.remarks[1]).to eq("schema scope - procedure parameter")
201
245
  expect(x.remarks[2]).to eq("universal scope - procedure parameter")
202
246
  end
203
-
247
+
204
248
  schema.procedures.first.types.first.tap do |x|
205
249
  expect(x).to be_instance_of(Expressir::Model::Type)
206
250
  expect(x.remarks).to be_instance_of(Array)
@@ -213,13 +257,16 @@ RSpec.describe Expressir::ExpressExp::Parser do
213
257
  x.type.items.first.tap do |x|
214
258
  expect(x).to be_instance_of(Expressir::Model::EnumerationItem)
215
259
  expect(x.remarks).to be_instance_of(Array)
216
- expect(x.remarks.count).to eq(3)
260
+ expect(x.remarks.count).to eq(6)
217
261
  expect(x.remarks[0]).to eq("procedure scope - procedure enumeration item")
218
- expect(x.remarks[1]).to eq("schema scope - procedure enumeration item")
219
- expect(x.remarks[2]).to eq("universal scope - procedure enumeration item")
262
+ expect(x.remarks[1]).to eq("procedure scope - procedure enumeration item, on the same level as the type")
263
+ expect(x.remarks[2]).to eq("schema scope - procedure enumeration item")
264
+ expect(x.remarks[3]).to eq("schema scope - procedure enumeration item, on the same level as the type")
265
+ expect(x.remarks[4]).to eq("universal scope - procedure enumeration item")
266
+ expect(x.remarks[5]).to eq("universal scope - procedure enumeration item, on the same level as the type")
220
267
  end
221
268
  end
222
-
269
+
223
270
  schema.procedures.first.constants.first.tap do |x|
224
271
  expect(x).to be_instance_of(Expressir::Model::Constant)
225
272
  expect(x.remarks).to be_instance_of(Array)
@@ -228,7 +275,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
228
275
  expect(x.remarks[1]).to eq("schema scope - procedure constant")
229
276
  expect(x.remarks[2]).to eq("universal scope - procedure constant")
230
277
  end
231
-
278
+
232
279
  schema.procedures.first.variables.first.tap do |x|
233
280
  expect(x).to be_instance_of(Expressir::Model::Variable)
234
281
  expect(x.remarks).to be_instance_of(Array)
@@ -237,21 +284,21 @@ RSpec.describe Expressir::ExpressExp::Parser do
237
284
  expect(x.remarks[1]).to eq("schema scope - procedure variable")
238
285
  expect(x.remarks[2]).to eq("universal scope - procedure variable")
239
286
  end
240
-
287
+
241
288
  schema.procedures.first.statements[0].tap do |x|
242
289
  expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
243
290
  expect(x.remarks).to be_instance_of(Array)
244
291
  expect(x.remarks.count).to eq(1)
245
292
  expect(x.remarks[0]).to eq("procedure alias scope - procedure alias")
246
293
  end
247
-
294
+
248
295
  schema.procedures.first.statements[1].tap do |x|
249
296
  expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
250
297
  expect(x.remarks).to be_instance_of(Array)
251
298
  expect(x.remarks.count).to eq(1)
252
299
  expect(x.remarks[0]).to eq("procedure repeat scope - procedure repeat")
253
300
  end
254
-
301
+
255
302
  schema.procedures.first.statements[2].tap do |x|
256
303
  expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
257
304
  expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QueryExpression)
@@ -259,7 +306,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
259
306
  expect(x.expression.remarks.count).to eq(1)
260
307
  expect(x.expression.remarks[0]).to eq("procedure query scope - procedure query")
261
308
  end
262
-
309
+
263
310
  schema.rules.first.tap do |x|
264
311
  expect(x).to be_instance_of(Expressir::Model::Rule)
265
312
  expect(x.remarks).to be_instance_of(Array)
@@ -267,7 +314,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
267
314
  expect(x.remarks[0]).to eq("schema scope - rule")
268
315
  expect(x.remarks[1]).to eq("universal scope - rule")
269
316
  end
270
-
317
+
271
318
  schema.rules.first.types.first.tap do |x|
272
319
  expect(x).to be_instance_of(Expressir::Model::Type)
273
320
  expect(x.remarks).to be_instance_of(Array)
@@ -280,13 +327,16 @@ RSpec.describe Expressir::ExpressExp::Parser do
280
327
  x.type.items.first.tap do |x|
281
328
  expect(x).to be_instance_of(Expressir::Model::EnumerationItem)
282
329
  expect(x.remarks).to be_instance_of(Array)
283
- expect(x.remarks.count).to eq(3)
330
+ expect(x.remarks.count).to eq(6)
284
331
  expect(x.remarks[0]).to eq("rule scope - rule enumeration item")
285
- expect(x.remarks[1]).to eq("schema scope - rule enumeration item")
286
- expect(x.remarks[2]).to eq("universal scope - rule enumeration item")
332
+ expect(x.remarks[1]).to eq("rule scope - rule enumeration item, on the same level as the type")
333
+ expect(x.remarks[2]).to eq("schema scope - rule enumeration item")
334
+ expect(x.remarks[3]).to eq("schema scope - rule enumeration item, on the same level as the type")
335
+ expect(x.remarks[4]).to eq("universal scope - rule enumeration item")
336
+ expect(x.remarks[5]).to eq("universal scope - rule enumeration item, on the same level as the type")
287
337
  end
288
338
  end
289
-
339
+
290
340
  schema.rules.first.constants.first.tap do |x|
291
341
  expect(x).to be_instance_of(Expressir::Model::Constant)
292
342
  expect(x.remarks).to be_instance_of(Array)
@@ -295,7 +345,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
295
345
  expect(x.remarks[1]).to eq("schema scope - rule constant")
296
346
  expect(x.remarks[2]).to eq("universal scope - rule constant")
297
347
  end
298
-
348
+
299
349
  schema.rules.first.variables.first.tap do |x|
300
350
  expect(x).to be_instance_of(Expressir::Model::Variable)
301
351
  expect(x.remarks).to be_instance_of(Array)
@@ -304,21 +354,21 @@ RSpec.describe Expressir::ExpressExp::Parser do
304
354
  expect(x.remarks[1]).to eq("schema scope - rule variable")
305
355
  expect(x.remarks[2]).to eq("universal scope - rule variable")
306
356
  end
307
-
357
+
308
358
  schema.rules.first.statements[0].tap do |x|
309
359
  expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
310
360
  expect(x.remarks).to be_instance_of(Array)
311
361
  expect(x.remarks.count).to eq(1)
312
362
  expect(x.remarks[0]).to eq("rule alias scope - rule alias")
313
363
  end
314
-
364
+
315
365
  schema.rules.first.statements[1].tap do |x|
316
366
  expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
317
367
  expect(x.remarks).to be_instance_of(Array)
318
368
  expect(x.remarks.count).to eq(1)
319
369
  expect(x.remarks[0]).to eq("rule repeat scope - rule repeat")
320
370
  end
321
-
371
+
322
372
  schema.rules.first.statements[2].tap do |x|
323
373
  expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
324
374
  expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QueryExpression)
@@ -326,14 +376,29 @@ RSpec.describe Expressir::ExpressExp::Parser do
326
376
  expect(x.expression.remarks.count).to eq(1)
327
377
  expect(x.expression.remarks[0]).to eq("rule query scope - rule query")
328
378
  end
329
-
379
+
330
380
  schema.rules.first.where.first.tap do |x|
331
381
  expect(x).to be_instance_of(Expressir::Model::Where)
332
382
  expect(x.remarks).to be_instance_of(Array)
333
- expect(x.remarks.count).to eq(3)
383
+ expect(x.remarks.count).to eq(6)
334
384
  expect(x.remarks[0]).to eq("rule scope - rule where")
335
- expect(x.remarks[1]).to eq("schema scope - rule where")
336
- expect(x.remarks[2]).to eq("universal scope - rule where")
385
+ expect(x.remarks[1]).to eq("rule scope - rule where, with prefix")
386
+ expect(x.remarks[2]).to eq("schema scope - rule where")
387
+ expect(x.remarks[3]).to eq("schema scope - rule where, with prefix")
388
+ expect(x.remarks[4]).to eq("universal scope - rule where")
389
+ expect(x.remarks[5]).to eq("universal scope - rule where, with prefix")
390
+ end
391
+
392
+ schema.rules.first.informal_propositions.first.tap do |x|
393
+ expect(x).to be_instance_of(Expressir::Model::InformalProposition)
394
+ expect(x.remarks).to be_instance_of(Array)
395
+ expect(x.remarks.count).to eq(6)
396
+ expect(x.remarks[0]).to eq("rule scope - rule informal proposition")
397
+ expect(x.remarks[1]).to eq("rule scope - rule informal proposition, with prefix")
398
+ expect(x.remarks[2]).to eq("schema scope - rule informal proposition")
399
+ expect(x.remarks[3]).to eq("schema scope - rule informal proposition, with prefix")
400
+ expect(x.remarks[4]).to eq("universal scope - rule informal proposition")
401
+ expect(x.remarks[5]).to eq("universal scope - rule informal proposition, with prefix")
337
402
  end
338
403
  end
339
404
  end