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 +4 -4
- data/.gemspec +1 -1
- data/VERSION +1 -1
- data/lib/bel_parser/language/expression_validator.rb +28 -12
- data/lib/bel_parser/language/semantics/nested_statement_without_object.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '01823862bc1188b0af06777dde1af62657b3bc1c'
|
4
|
+
data.tar.gz: 0a6f806d2ab8db3cbf6f20125a223b4da645edc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 153744fb2ceab06399607a2472abe20dda031b0dea91074f4cd054a1a2a3f6aaba76bc9906558df1852fd7a4f83f0554484db1ffb13fde88a39a2dcdac55c2a2
|
7
|
+
data.tar.gz: 289f6c1934ffdcc61fb4a2d6c9a0705c77a3613afb79f44ce219c6cef2d3d73dd5c6b1e92cb39821440b5c1d569bf98aa39baa9e73cde0acbc5357fb13c92f16
|
data/.gemspec
CHANGED
data/VERSION
CHANGED
@@ -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(
|
57
|
+
TermResult.new(
|
58
|
+
expression_node,
|
59
|
+
syntax(expression_node),
|
60
|
+
semantics(expression_node))
|
54
61
|
when BELParser::Parsers::AST::Parameter
|
55
|
-
ParameterResult.new(
|
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
|
100
|
+
.select { |res|
|
91
101
|
res.is_a?(Semantics::SignatureMappingSuccess)
|
92
|
-
|
102
|
+
}
|
103
|
+
.uniq
|
93
104
|
end
|
94
105
|
|
95
106
|
def invalid_signature_mappings
|
96
107
|
@semantics_results
|
97
|
-
.select
|
108
|
+
.select { |res|
|
98
109
|
res.is_a?(Semantics::SignatureMappingWarning)
|
99
|
-
|
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
|
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.
|
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-
|
12
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sparql-client
|