rpeg 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -6
- 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: 436fa3e6af0de7e1c8bd4fa910dfb64ca9c20649ce19bb11d4d1d70d7f34a5d5
|
4
|
+
data.tar.gz: 186d462c9f00d96390bf95a48e649948a2f353403c4e67de5a2bde3a7ec00b15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d8d7fc7a9036bceff28eb2cf9aa034915af540aeda935f7e71cd8384d888f806cbe5e231d12b089054a1bd4c8ca6aa24ca55f2d197501b1c4dabe7803da83a
|
7
|
+
data.tar.gz: 057ae4f1aa9643ed84c455cb2ebbc35bd2042b7e31b3cae1a1409ac56255eb1e57ce49ff95957ad1c159560b21f2c1a88d0f629e9d32e40f4fa63789bc667af9
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ RPeg is a Ruby port of [LPeg](http://www.inf.puc-rio.br/~roberto/lpeg/), Lua's p
|
|
5
5
|
|
6
6
|
This project doesn't contain documentation of the library's functionality. For that, see the LPeg page, keeping in mind the
|
7
7
|
differences in the Ruby port, described below. For a theoretical justification of the use of PEGs for pattern matching and a lot of
|
8
|
-
detail of the internal design of LPeg, see
|
8
|
+
detail of the internal design of LPeg, see [[Ierusalimschy]](#refereces).
|
9
9
|
|
10
10
|
## Why You Should Use RPeg
|
11
11
|
|
@@ -19,8 +19,8 @@ easier to read and maintain.
|
|
19
19
|
## Why You Should Not Use RPeg
|
20
20
|
|
21
21
|
I wrote RPeg as learning exercise and for my own illumination. I was interested in how regular expressions can be implemented
|
22
|
-
efficiently using a virtual machine ([[Cox]](#references)) and stumbled on Ierusalimschy's paper. I found that paper fascinating
|
23
|
-
decided to try to implement the algorithm in Ruby.
|
22
|
+
efficiently using a virtual machine (see [[Cox]](#references)) and stumbled on Ierusalimschy's paper. I found that paper fascinating
|
23
|
+
and decided to try to implement the algorithm in Ruby.
|
24
24
|
|
25
25
|
### It is slow
|
26
26
|
|
@@ -32,8 +32,8 @@ milliseconds. RPeg, on more modern hardware[^1], takes 5.4 seconds (!) for the s
|
|
32
32
|
don't think it will get any faster.
|
33
33
|
|
34
34
|
Of course, Ruby can call C code just as well as Lua can, but I am not going to attempt to write RPeg in C. The LPeg code is very
|
35
|
-
carefully written to do all of the necessary memory managment, and it gets
|
36
|
-
have no interest in attempting this for RPeg.
|
35
|
+
carefully written to do all of the necessary memory managment, and it gets especially complicated in the implemention of "runtime
|
36
|
+
captures". I have no interest in attempting this for RPeg.
|
37
37
|
|
38
38
|
### It is not industrial-strength
|
39
39
|
|
@@ -148,7 +148,7 @@ is an array. In RPeg, returns from function in contexts like this are treated as
|
|
148
148
|
|
149
149
|
|
150
150
|
# References
|
151
|
-
- [Ierusalimschy] Ierusalimschy, R., _Text Pattern-Matching Tool based on Parsing Expression Grammars_, Software: Practice and Experience, 39(3):221-258, https://doi.org/10.1002/spe.892, http://www.inf.puc-rio.br/~roberto/docs/peg.pdf (retrieved 2022-01-??).
|
151
|
+
- [Ierusalimschy] Ierusalimschy, R., _Text Pattern-Matching Tool based on Parsing Expression Grammars_, Software: Practice and Experience, 39(3):221-258, Wiley, 2009, https://doi.org/10.1002/spe.892, http://www.inf.puc-rio.br/~roberto/docs/peg.pdf (retrieved 2022-01-??).
|
152
152
|
- [Cox] Cox, R., _Regular Expression Matching: the Virtual Machine Approach_, https://swtch.com/~rsc/regexp/regexp2.html.
|
153
153
|
|
154
154
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpeg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rory Molinari
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
rubygems_version: 3.
|
77
|
+
rubygems_version: 3.4.10
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: A Ruby port of LPEG, Lua's Parsing Expression Grammar library.
|