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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dad59e40690dfb746fea4399e13d05f97b43cf562c2559c67d1f9b5868da86c5
4
- data.tar.gz: 0c14605ecf34929f6d4865c20f085b6ef2a35533a70e530f261f9d04f44998cb
3
+ metadata.gz: 5e8b4b78bfb538253820b4ff34d49ebf7a91f9722c0ecfb63e3dadb3067530cb
4
+ data.tar.gz: e8e6e9cc42513094304d79a10fb4802706b10cb147084683c5dd3315c2ecde9a
5
5
  SHA512:
6
- metadata.gz: 4fa69e55ac577e55fa2945ef9c135b47359a646e654bc8cf9f2ead973852adb97350cf67ac5da549592ea583f4824cd5f6930a167fa19cf3f914cb6d6888093d
7
- data.tar.gz: 0c13eb02ffaf3b3c60ef358be2fa8f70b951e947170d3eeb8a94e5c37bec5dc8282376e4ab3f03de99e49b6e2aac2aa13169b31c30de1067e1a290c1fd65803a
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
@@ -29,6 +29,8 @@ lib/ruby27_parser.rb
29
29
  lib/ruby27_parser.y
30
30
  lib/ruby30_parser.rb
31
31
  lib/ruby30_parser.y
32
+ lib/ruby31_parser.rb
33
+ lib/ruby31_parser.y
32
34
  lib/ruby3_parser.yy
33
35
  lib/ruby_lexer.rb
34
36
  lib/ruby_lexer.rex
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/ruby_parser.yy.
66
- * Extend lib/ruby_parser.yy with new class name.
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
- * Extend sexp_processor's pt_testcase.rb to match version
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 version
188
- when /2\.7|3\.0/
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 = %w[ 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3.0 ]
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.8"
295
- ruby_parse "2.7.4"
296
- ruby_parse "3.0.2"
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 ~/Work/git/rubygems/rubygems-mirror
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 `hash.rb` (TODO: needs a better name):
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
- % mv hashed.noindex gauntlet.$(today).noindex
44
- % lrztar gauntlet.$(today).noindex
45
- % mv gauntlet.$(today).noindex.lrz /Volumes/StuffA/gauntlet/
46
- ```
47
-
48
- This script filters all the newer gems (TODO: WHY?), unpacks them,
49
- finds all the files that look like they're valid ruby, ensures they're
50
- valid ruby (using the current version of ruby to compile them), and
51
- then moves them into a SHA dir structure that looks something like
52
- this:
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