bel_parser 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: 918e134aad64f9a085893f1efe594fc7c7bc8176
4
- data.tar.gz: 58c493d5631689b4230e9055dbe443381abe9e75
3
+ metadata.gz: '01823862bc1188b0af06777dde1af62657b3bc1c'
4
+ data.tar.gz: 0a6f806d2ab8db3cbf6f20125a223b4da645edc1
5
5
  SHA512:
6
- metadata.gz: 747d0dfc27dae01731d43e7d464819d935be23d96a78321a88d6e82947a8a3389745381e1a23343a96494c25d43308807f8af31076e9a09e82598e6ee0ab4924
7
- data.tar.gz: ff4584aa710cdba505a0ec05c24d731b8c8b058608178432cbd42d108bf054080372f3d1d6ae0e78a49105fed85dd793c27d3235207e9adec5f2da8ac103bd39
6
+ metadata.gz: 153744fb2ceab06399607a2472abe20dda031b0dea91074f4cd054a1a2a3f6aaba76bc9906558df1852fd7a4f83f0554484db1ffb13fde88a39a2dcdac55c2a2
7
+ data.tar.gz: 289f6c1934ffdcc61fb4a2d6c9a0705c77a3613afb79f44ce219c6cef2d3d73dd5c6b1e92cb39821440b5c1d569bf98aa39baa9e73cde0acbc5357fb13c92f16
data/.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  'Anthony Bargnesi',
12
12
  'Nick Bargnesi',
13
13
  ]
14
- spec.date = %q{2017-01-13}
14
+ spec.date = %q{2017-01-23}
15
15
  spec.email = %q{abargnesi@selventa.com}
16
16
  spec.files = [
17
17
  Dir.glob('lib/**/*.{rb,rl}'),
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -28,31 +28,41 @@ module BELParser
28
28
  case expression_node
29
29
  when BELParser::Parsers::AST::SimpleStatement
30
30
  SimpleStatementResult.new(
31
+ expression_node,
31
32
  validate(expression_node.statement.subject.term),
32
33
  validate(expression_node.statement.object.child),
33
34
  syntax(expression_node),
34
35
  semantics(expression_node))
35
36
  when BELParser::Parsers::AST::ObservedTerm
36
37
  ObservedTermResult.new(
38
+ expression_node,
37
39
  validate(expression_node.statement.subject.term),
38
40
  syntax(expression_node),
39
41
  semantics(expression_node))
40
42
  when BELParser::Parsers::AST::NestedStatement
41
43
  NestedStatementResult.new(
44
+ expression_node,
42
45
  validate(expression_node.statement.subject.term),
43
46
  validate(expression_node.statement.object.child),
44
47
  syntax(expression_node),
45
48
  semantics(expression_node))
46
49
  when BELParser::Parsers::AST::Statement
47
50
  SimpleStatementResult.new(
51
+ expression_node,
48
52
  validate(expression_node.subject.term),
49
53
  validate(expression_node.object.child),
50
54
  syntax(expression_node),
51
55
  semantics(expression_node))
52
56
  when BELParser::Parsers::AST::Term
53
- TermResult.new(syntax(expression_node), semantics(expression_node))
57
+ TermResult.new(
58
+ expression_node,
59
+ syntax(expression_node),
60
+ semantics(expression_node))
54
61
  when BELParser::Parsers::AST::Parameter
55
- ParameterResult.new(syntax(expression_node), semantics(expression_node))
62
+ ParameterResult.new(
63
+ expression_node,
64
+ syntax(expression_node),
65
+ semantics(expression_node))
56
66
  else
57
67
  nil
58
68
  end
@@ -87,16 +97,17 @@ module BELParser
87
97
 
88
98
  def valid_signature_mappings
89
99
  @semantics_results
90
- .select do |res|
100
+ .select { |res|
91
101
  res.is_a?(Semantics::SignatureMappingSuccess)
92
- end.uniq
102
+ }
103
+ .uniq
93
104
  end
94
105
 
95
106
  def invalid_signature_mappings
96
107
  @semantics_results
97
- .select do |res|
108
+ .select { |res|
98
109
  res.is_a?(Semantics::SignatureMappingWarning)
99
- end
110
+ }
100
111
  end
101
112
 
102
113
  def detail
@@ -135,7 +146,8 @@ module BELParser
135
146
  attr_reader :syntax_results, :semantics_results
136
147
  include Result
137
148
 
138
- def initialize(syntax_results, semantics_results)
149
+ def initialize(expression_node, syntax_results, semantics_results)
150
+ @expression_node = expression_node
139
151
  @syntax_results = syntax_results
140
152
  @semantics_results = semantics_results
141
153
  end
@@ -153,14 +165,15 @@ module BELParser
153
165
  attr_reader :syntax_results, :semantics_results
154
166
  include Result
155
167
 
156
- def initialize(syntax_results, semantics_results)
168
+ def initialize(expression_node, syntax_results, semantics_results)
169
+ @expression_node = expression_node
157
170
  @syntax_results = syntax_results
158
171
  @semantics_results = semantics_results
159
172
  end
160
173
 
161
174
  def valid_semantics?
162
175
  @semantics_results.any? do |res|
163
- res.is_a?(Semantics::SignatureMappingSuccess)
176
+ res.is_a?(Semantics::SignatureMappingSuccess) && res.expression_node == @expression_node
164
177
  end
165
178
  end
166
179
 
@@ -189,7 +202,8 @@ module BELParser
189
202
  attr_reader :syntax_results, :semantics_results
190
203
  include Result
191
204
 
192
- def initialize(subject_result, syntax, semantics)
205
+ def initialize(expression_node, subject_result, syntax, semantics)
206
+ @expression_node = expression_node
193
207
  @subject_result = subject_result
194
208
  @syntax_results = syntax
195
209
  @semantics_results =
@@ -236,7 +250,8 @@ module BELParser
236
250
  attr_reader :syntax_results, :semantics_results
237
251
  include Result
238
252
 
239
- def initialize(subject_result, object_result, syntax, semantics)
253
+ def initialize(expression_node, subject_result, object_result, syntax, semantics)
254
+ @expression_node = expression_node
240
255
  @subject_result = subject_result
241
256
  @object_result = object_result
242
257
  @syntax_results = syntax
@@ -342,7 +357,8 @@ module BELParser
342
357
  attr_reader :syntax_results, :semantics_results
343
358
  include Result
344
359
 
345
- def initialize(subject_result, object_result, syntax, semantics)
360
+ def initialize(expression_node, subject_result, object_result, syntax, semantics)
361
+ @expression_node = expression_node
346
362
  @subject_result = subject_result
347
363
  @object_result = object_result
348
364
  @syntax_results = syntax
@@ -17,7 +17,7 @@ module BELParser
17
17
 
18
18
  nested = node.object.child
19
19
 
20
- if nested.object?
20
+ unless nested.object?
21
21
  NestedStatementWithoutObjectWarning.new(node, spec)
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bel_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Bargnesi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-13 00:00:00.000000000 Z
12
+ date: 2017-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sparql-client