rley 0.7.05 → 0.7.06
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/lib/rley/constants.rb +1 -1
- data/lib/rley/parse_rep/parse_forest_builder.rb +10 -7
- data/lib/rley/parser/parse_walker_factory.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 530d84f2a821ca2a7e9a62dde68b6c70107b9539ca4f50842f035691c6b9f858
|
4
|
+
data.tar.gz: fee6189c812d4062ff148d206806bf9816280babce84b311066edf016406e9f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c58d32795908e5b570db16519ce9e3506813bee14f3cf914938625c4820dd7a138b6d1cb18991fc340cf4e6a4777e7b57c293e1c5cd47ae81fde2c884581208b
|
7
|
+
data.tar.gz: 246245e61c7a2dcda26117f8d3819f85c12dffa0917a400dcff6e22fff805930b9faf4b37c09e0202753bac0f170272db5b818e78c27047bef4a13dc510f94e9
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
### 0.7.
|
1
|
+
### 0.7.06 / 2019-11-22
|
2
|
+
- [FIX] Method `ParseForestBuilder#process_end_entry`: Added a guard expression to prevent nil error.
|
3
|
+
|
4
|
+
### 0.7.05 / 2019-11-17
|
2
5
|
- [FIX] Method `GFGParsing#nullable_rule`: issue with nullable productions having at least one member in their rhs.
|
3
6
|
|
4
7
|
### 0.7.04 / 2019-08-17
|
data/lib/rley/constants.rb
CHANGED
@@ -42,7 +42,7 @@ module Rley # This module is used as a namespace
|
|
42
42
|
@entry2node = {}
|
43
43
|
@entry2path_to_alt = {}
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
# Notify the builder that the construction is over
|
47
47
|
def done!()
|
48
48
|
result.done!
|
@@ -65,19 +65,20 @@ module Rley # This module is used as a namespace
|
|
65
65
|
|
66
66
|
# Return the current_parent node
|
67
67
|
def curr_parent()
|
68
|
-
|
68
|
+
curr_path.last
|
69
69
|
end
|
70
70
|
|
71
71
|
private
|
72
72
|
|
73
73
|
def process_start_entry(_anEvent, _anEntry, _anIndex)
|
74
74
|
curr_path.pop
|
75
|
+
raise StandardError, "path is nil for #{anEntry}" if curr_path.nil?
|
75
76
|
end
|
76
77
|
|
77
78
|
def process_end_entry(anEvent, anEntry, anIndex)
|
78
79
|
case anEvent
|
79
80
|
when :visit
|
80
|
-
# create a node with the non-terminal
|
81
|
+
# create a forest node with the non-terminal
|
81
82
|
# with same right extent as curr_entry_set_index
|
82
83
|
# add the new node as first child of current_parent
|
83
84
|
# append the new node to the curr_path
|
@@ -92,14 +93,15 @@ module Rley # This module is used as a namespace
|
|
92
93
|
raise StandardError, "path is nil for #{anEntry}" if curr_path.nil?
|
93
94
|
|
94
95
|
when :revisit
|
95
|
-
# Retrieve the already existing node corresponding
|
96
|
+
# Retrieve the already existing forest node corresponding
|
96
97
|
# to re-visited entry
|
97
98
|
popular = @entry2node[anEntry]
|
98
99
|
|
99
100
|
# Share with parent (if needed)...
|
100
|
-
|
101
|
-
|
102
|
-
|
101
|
+
if curr_parent
|
102
|
+
children = curr_parent.subnodes
|
103
|
+
curr_parent.add_subnode(popular) unless children.include? popular
|
104
|
+
end
|
103
105
|
else
|
104
106
|
raise NotImplementedError
|
105
107
|
end
|
@@ -242,6 +244,7 @@ module Rley # This module is used as a namespace
|
|
242
244
|
# Add the given node as sub-node of current parent node
|
243
245
|
# Optionally add the node to the current path
|
244
246
|
def add_subnode(aNode, addToPath = true)
|
247
|
+
raise StandardError, 'node is nil' if aNode.nil?
|
245
248
|
curr_parent.add_subnode(aNode) unless curr_path.empty?
|
246
249
|
curr_path << aNode if addToPath
|
247
250
|
end
|
@@ -242,7 +242,7 @@ module Rley # This module is used as a namespace
|
|
242
242
|
bp.visitee = aContext.curr_entry
|
243
243
|
bp.antecedent_index = 0
|
244
244
|
aContext.backtrack_points << bp
|
245
|
-
|
245
|
+
# puts "Backtrack size after addition #{aContext.backtrack_points.size}"
|
246
246
|
return bp
|
247
247
|
end
|
248
248
|
|
@@ -260,6 +260,7 @@ module Rley # This module is used as a namespace
|
|
260
260
|
aContext.backtrack_points.pop
|
261
261
|
end
|
262
262
|
# puts "Backtracking to #{bp.visitee}"
|
263
|
+
# puts "Backtrack size after backtracking #{aContext.backtrack_points.size}"
|
263
264
|
|
264
265
|
# Emit a backtrack event
|
265
266
|
return [:backtrack, bp.visitee, aContext.entry_set_index]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rley
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.06
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|