ruby_parser 3.18.1 → 3.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +21 -0
- data/Manifest.txt +2 -0
- data/README.rdoc +8 -6
- data/Rakefile +8 -7
- data/gauntlet.md +17 -15
- data/lib/ruby20_parser.rb +5871 -2026
- data/lib/ruby20_parser.y +14 -27
- data/lib/ruby21_parser.rb +5847 -2049
- data/lib/ruby21_parser.y +14 -27
- data/lib/ruby22_parser.rb +5969 -2074
- data/lib/ruby22_parser.y +14 -27
- data/lib/ruby23_parser.rb +5973 -2078
- data/lib/ruby23_parser.y +14 -27
- data/lib/ruby24_parser.rb +6061 -2098
- data/lib/ruby24_parser.y +14 -27
- data/lib/ruby25_parser.rb +6061 -2098
- data/lib/ruby25_parser.y +14 -27
- data/lib/ruby26_parser.rb +6063 -2097
- data/lib/ruby26_parser.y +14 -27
- data/lib/ruby27_parser.rb +6862 -2399
- data/lib/ruby27_parser.y +19 -41
- data/lib/ruby30_parser.rb +7162 -2671
- data/lib/ruby30_parser.y +65 -90
- data/lib/ruby31_parser.rb +13622 -0
- data/lib/ruby31_parser.y +3481 -0
- data/lib/ruby3_parser.yy +149 -89
- data/lib/ruby_parser.rb +2 -0
- data/lib/ruby_parser.yy +19 -41
- data/lib/ruby_parser_extras.rb +46 -1
- data/test/test_ruby_parser.rb +116 -0
- data.tar.gz.sig +0 -0
- metadata +18 -13
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e8b4b78bfb538253820b4ff34d49ebf7a91f9722c0ecfb63e3dadb3067530cb
|
4
|
+
data.tar.gz: e8e6e9cc42513094304d79a10fb4802706b10cb147084683c5dd3315c2ecde9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd72b30995fbc5ad74f04dedc341572d03b73b962ddd2dd3ecd255c8d1babe1b4e190b780588b846f2c8b8942327ac4a50bda0e8401d02037299f9b16965e69b
|
7
|
+
data.tar.gz: 5793d0f9bf5e11f56db8eb5b53fd4b603664e72818b4bc43a3bfb61cf3c4a0c61f9ecee3757350a684271ae9e0c434782ef739ef0f075b3897fa338bcd2680c5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
=== 3.19.0 / 2022-03-29
|
2
|
+
|
3
|
+
* 1 major enhancement:
|
4
|
+
|
5
|
+
* Added tentative 3.1 support.
|
6
|
+
|
7
|
+
* 7 minor enhancements:
|
8
|
+
|
9
|
+
* 3.1: bare RHS assoc: { y: } => s(:hash, s(:lit, :y), nil)
|
10
|
+
* 3.1: calls w/ unnamed block args (bare &)
|
11
|
+
* 3.1: endless defn/defs w/ paren-less calls (aka commands)
|
12
|
+
* 3.1: pattern capture to nonlocal vars, eg: ^@a, ^$b, ^@@c
|
13
|
+
* 3.1: pattern: ^(expr) => expr
|
14
|
+
* Improved steps for adding new versions.
|
15
|
+
* Improved steps for running gauntlets.
|
16
|
+
|
17
|
+
* 2 bug fixes:
|
18
|
+
|
19
|
+
* Bumped 2.6+ cached versions for rake compare.
|
20
|
+
* Skip test_regexp_esc_C_slash on ruby 3.1.0 because of MRI bug.
|
21
|
+
|
1
22
|
=== 3.18.1 / 2021-11-10
|
2
23
|
|
3
24
|
* 1 minor enhancement:
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -33,6 +33,9 @@ Tested against 801,039 files from the latest of all rubygems (as of 2013-05):
|
|
33
33
|
* 1.9 parser is at 99.9940% accuracy, 4.013 sigma
|
34
34
|
* 2.0 parser is at 99.9939% accuracy, 4.008 sigma
|
35
35
|
* 2.6 parser is at 99.9972% accuracy, 4.191 sigma
|
36
|
+
* 3.0 parser has a 100% parse rate.
|
37
|
+
* Tested against 2,672,412 unique ruby files across 167k gems.
|
38
|
+
* As do all the others now, basically.
|
36
39
|
|
37
40
|
== FEATURES/PROBLEMS:
|
38
41
|
|
@@ -62,15 +65,14 @@ You can also use Ruby19Parser, Ruby18Parser, or RubyParser.for_current_ruby:
|
|
62
65
|
|
63
66
|
To add a new version:
|
64
67
|
|
65
|
-
* New parser should be generated from lib/
|
66
|
-
* Extend lib/
|
67
|
-
* Add new version number to V2 in Rakefile for rule creation.
|
68
|
+
* New parser should be generated from lib/ruby[3]_parser.yy.
|
69
|
+
* Extend lib/ruby[3]_parser.yy with new class name.
|
70
|
+
* Add new version number to V2/V3 in Rakefile for rule creation.
|
71
|
+
* Add new (full) version to `ruby_parse` section of Rakefile for rake compare
|
68
72
|
* Require generated parser in lib/ruby_parser.rb.
|
69
73
|
* Add empty TestRubyParserShared##Plus module and TestRubyParserV## to test/test_ruby_parser.rb.
|
70
74
|
* Extend Manifest.txt with generated file names.
|
71
|
-
*
|
72
|
-
* add_19tests needs to have the version added
|
73
|
-
* VER_RE needs to have the regexp expanded
|
75
|
+
* Add new version number to sexp_processor's pt_testcase.rb in all_versions
|
74
76
|
|
75
77
|
Until all of these are done, you won't have a clean test run.
|
76
78
|
|
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ Hoe.add_include_dirs "../../minitest/dev/lib"
|
|
14
14
|
Hoe.add_include_dirs "../../oedipus_lex/dev/lib"
|
15
15
|
|
16
16
|
V2 = %w[20 21 22 23 24 25 26 27]
|
17
|
-
V3 = %w[30]
|
17
|
+
V3 = %w[30 31]
|
18
18
|
|
19
19
|
VERS = V2 + V3
|
20
20
|
|
@@ -184,8 +184,8 @@ def ruby_parse version
|
|
184
184
|
|
185
185
|
file c_parse_y => c_tarball do
|
186
186
|
in_compare do
|
187
|
-
extract_glob = case
|
188
|
-
when
|
187
|
+
extract_glob = case
|
188
|
+
when version > "2.7" then
|
189
189
|
"{id.h,parse.y,tool/{id2token.rb,lib/vpath.rb}}"
|
190
190
|
else
|
191
191
|
"{id.h,parse.y,tool/{id2token.rb,vpath.rb}}"
|
@@ -258,7 +258,7 @@ task :versions do
|
|
258
258
|
require "net/http" # avoid require issues in threads
|
259
259
|
require "net/https"
|
260
260
|
|
261
|
-
versions =
|
261
|
+
versions = VERS.map { |s| s.split(//).join "." }
|
262
262
|
|
263
263
|
base_url = "https://cache.ruby-lang.org/pub/ruby"
|
264
264
|
|
@@ -291,9 +291,10 @@ ruby_parse "2.2.10"
|
|
291
291
|
ruby_parse "2.3.8"
|
292
292
|
ruby_parse "2.4.10"
|
293
293
|
ruby_parse "2.5.9"
|
294
|
-
ruby_parse "2.6.
|
295
|
-
ruby_parse "2.7.
|
296
|
-
ruby_parse "3.0.
|
294
|
+
ruby_parse "2.6.9"
|
295
|
+
ruby_parse "2.7.5"
|
296
|
+
ruby_parse "3.0.3"
|
297
|
+
ruby_parse "3.1.1"
|
297
298
|
|
298
299
|
task :debug => :isolate do
|
299
300
|
ENV["V"] ||= VERS.last
|
data/gauntlet.md
CHANGED
@@ -19,10 +19,10 @@ an external disk. Here is the config:
|
|
19
19
|
And I update using rake:
|
20
20
|
|
21
21
|
```
|
22
|
-
% cd
|
22
|
+
% cd GIT/rubygems/rubygems-mirror
|
23
23
|
% git down
|
24
24
|
% rake mirror:latest
|
25
|
-
% /Volumes/StuffA/gauntlet/bin/cleanup.rb
|
25
|
+
% /Volumes/StuffA/gauntlet/bin/cleanup.rb -y -v
|
26
26
|
```
|
27
27
|
|
28
28
|
This rather quickly updates my mirror to the latest versions of
|
@@ -34,22 +34,24 @@ bit, but it is pretty minimal (currently ~20 bad gems).
|
|
34
34
|
## Curating an Archive of Ruby Files
|
35
35
|
|
36
36
|
Next, I process the gem mirror into a much more digestable structure
|
37
|
-
using `
|
37
|
+
using `unpack_gems.rb`.
|
38
38
|
|
39
39
|
```
|
40
|
-
% cd RP
|
41
|
-
% /Volumes/StuffA/gauntlet/bin/unpack_gems.rb
|
40
|
+
% cd RP/gauntlet
|
41
|
+
% time caffeinate /Volumes/StuffA/gauntlet/bin/unpack_gems.rb -v [-a] ; say done
|
42
42
|
... waaaait ...
|
43
|
-
%
|
44
|
-
%
|
45
|
-
%
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
% DIR=gauntlet.$(today).(all|new).noindex
|
44
|
+
% mv hashed.noindex $DIR
|
45
|
+
% tar c $DIR | zstd -5 -T0 --long > archives/$DIR.tar.zst
|
46
|
+
% tar vc -T <(fd . $DIR | sort) | zstd -5 -T0 --long > archives/$DIR.tar.zst
|
47
|
+
% ./bin/sync.sh
|
48
|
+
```
|
49
|
+
|
50
|
+
This script filters all the newer (< 1 year old) gems (unless `-a` is
|
51
|
+
used), unpacks them, finds all the files that look like they're valid
|
52
|
+
ruby, ensures they're valid ruby (using the current version of ruby to
|
53
|
+
compile them), and then moves them into a SHA dir structure that looks
|
54
|
+
something like this:
|
53
55
|
|
54
56
|
```
|
55
57
|
hashed.noindex/a/b/c/<full_file_sha>.rb
|