parse_queue 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/images/queue.png +0 -0
- data/lib/parse_queue/version.rb +1 -1
- data/parse_queue.gemspec +1 -2
- metadata +7 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63bff899ff5bf108e50afeba001b1a08569d6c1d
|
4
|
+
data.tar.gz: 61238d41bdf7df2ce742b29820dbd711c94be06f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21fd07a6b7f3d3d4d18ccd8a196886eb661a2f2c332b3a0eac34649d86d449e3973f494fecf80b0e8a4a1724a1bac418cfd2d6df228f43b4d50c4d2ed13079ec
|
7
|
+
data.tar.gz: 25e4f71011d19f30b72f8eef5c4fb3db59a836d4715c3e5dc95f355948701a35085a678c0f288419ecd7f6c1c5cc3949c7385b9194f0b41d970972374271e82d
|
data/README.md
CHANGED
@@ -13,6 +13,10 @@ This can be seen in parser names like LL(0), LL(1), LR(1), LALR(n), etc. The
|
|
13
13
|
parse queue provides for a flexible look-ahead removing this burden from other
|
14
14
|
compiler components.
|
15
15
|
|
16
|
+
The operation of the parse queue is summarized in the following diagram:
|
17
|
+
|
18
|
+
![parse queue](./images/queue.png)
|
19
|
+
|
16
20
|
## Installation
|
17
21
|
|
18
22
|
Add this line to your application's Gemfile:
|
@@ -104,7 +108,7 @@ a value saved off at an earlier point of the processing. For example:
|
|
104
108
|
|
105
109
|
#### Shifting
|
106
110
|
|
107
|
-
So far, items have been retained in the queue, even
|
111
|
+
So far, items have been retained in the queue, even after they are done being
|
108
112
|
processed. For large files, this may use a large amount of memory. To avoid
|
109
113
|
this, used items need to be shifted out of the parse queue. This can be done as
|
110
114
|
follows:
|
@@ -118,9 +122,9 @@ follows:
|
|
118
122
|
}
|
119
123
|
```
|
120
124
|
Note how the try! block returns a value called success. If this value is false
|
121
|
-
or nil, the parse queue is rolled back to its condition at the start of the
|
122
|
-
block. Otherwise, any changes to the parse queue are retained and
|
123
|
-
items are removed.
|
125
|
+
or nil, the parse queue is rolled back to its condition at the start of the
|
126
|
+
try! block. Otherwise, any changes to the parse queue are retained and
|
127
|
+
processed items are removed.
|
124
128
|
|
125
129
|
This too can be done manually as shown below:
|
126
130
|
|
@@ -138,6 +142,16 @@ This too can be done manually as shown below:
|
|
138
142
|
Note that if an attempt is made to fall back to data that has been shifted out,
|
139
143
|
a **ParseQueueNoRev** exception is raised.
|
140
144
|
|
145
|
+
#### Exceptions
|
146
|
+
|
147
|
+
The parse queue uses the following exception classes:
|
148
|
+
|
149
|
+
Exception # From Ruby.
|
150
|
+
StandardError # From Ruby.
|
151
|
+
ParseQueueError # The abstract root of parse queue exceptions.
|
152
|
+
ParseQueueNoFwd # Error: Can't go forward.
|
153
|
+
ParseQueueNoRev # Error: Can't fall back.
|
154
|
+
|
141
155
|
## Contributing
|
142
156
|
|
143
157
|
#### Plan A
|
data/images/queue.png
ADDED
Binary file
|
data/lib/parse_queue/version.rb
CHANGED
data/parse_queue.gemspec
CHANGED
@@ -21,8 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.required_ruby_version = '>=2.3.0'
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.15"
|
24
|
-
spec.add_development_dependency "rake", "
|
24
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
25
25
|
spec.add_development_dependency "minitest", "~> 5.0"
|
26
|
-
spec.add_development_dependency 'minitest_visible', "~> 0.1"
|
27
26
|
spec.add_development_dependency 'reek', "~> 5.0.2"
|
28
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parse_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PeterCamilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 12.3.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 12.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: minitest_visible
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.1'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0.1'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: reek
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,6 +79,7 @@ files:
|
|
93
79
|
- Gemfile
|
94
80
|
- LICENSE.txt
|
95
81
|
- README.md
|
82
|
+
- images/queue.png
|
96
83
|
- lib/parse_queue.rb
|
97
84
|
- lib/parse_queue/exceptions.rb
|
98
85
|
- lib/parse_queue/version.rb
|