ruby_parser 3.13.1 → 3.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.autotest +18 -29
  4. data/History.rdoc +312 -0
  5. data/Manifest.txt +16 -15
  6. data/README.rdoc +13 -9
  7. data/Rakefile +237 -106
  8. data/bin/ruby_parse +3 -1
  9. data/bin/ruby_parse_extract_error +9 -4
  10. data/compare/normalize.rb +54 -6
  11. data/debugging.md +172 -0
  12. data/gauntlet.md +107 -0
  13. data/lib/rp_extensions.rb +15 -36
  14. data/lib/rp_stringscanner.rb +20 -51
  15. data/lib/ruby_lexer.rb +515 -812
  16. data/lib/ruby_lexer.rex +33 -27
  17. data/lib/ruby_lexer.rex.rb +64 -31
  18. data/lib/ruby_lexer_strings.rb +638 -0
  19. data/lib/ruby_parser.rb +46 -36
  20. data/lib/{ruby_parser.yy → ruby_parser2.yy} +1400 -488
  21. data/lib/ruby_parser20.rb +10953 -0
  22. data/lib/ruby_parser21.rb +10978 -0
  23. data/lib/ruby_parser22.rb +11119 -0
  24. data/lib/ruby_parser23.rb +11160 -0
  25. data/lib/ruby_parser24.rb +11209 -0
  26. data/lib/ruby_parser25.rb +11209 -0
  27. data/lib/ruby_parser26.rb +11231 -0
  28. data/lib/ruby_parser27.rb +12960 -0
  29. data/lib/{ruby26_parser.y → ruby_parser3.yy} +1652 -521
  30. data/lib/ruby_parser30.rb +13292 -0
  31. data/lib/ruby_parser31.rb +13625 -0
  32. data/lib/ruby_parser32.rb +13577 -0
  33. data/lib/ruby_parser33.rb +13577 -0
  34. data/lib/ruby_parser_extras.rb +988 -474
  35. data/test/test_ruby_lexer.rb +1339 -1155
  36. data/test/test_ruby_parser.rb +4255 -2103
  37. data/test/test_ruby_parser_extras.rb +39 -4
  38. data/tools/munge.rb +52 -13
  39. data/tools/ripper.rb +24 -6
  40. data.tar.gz.sig +0 -0
  41. metadata +73 -56
  42. metadata.gz.sig +0 -0
  43. data/lib/ruby20_parser.rb +0 -6869
  44. data/lib/ruby20_parser.y +0 -2431
  45. data/lib/ruby21_parser.rb +0 -6944
  46. data/lib/ruby21_parser.y +0 -2449
  47. data/lib/ruby22_parser.rb +0 -6968
  48. data/lib/ruby22_parser.y +0 -2458
  49. data/lib/ruby23_parser.rb +0 -6987
  50. data/lib/ruby23_parser.y +0 -2460
  51. data/lib/ruby24_parser.rb +0 -6994
  52. data/lib/ruby24_parser.y +0 -2466
  53. data/lib/ruby25_parser.rb +0 -6994
  54. data/lib/ruby25_parser.y +0 -2466
  55. data/lib/ruby26_parser.rb +0 -7012
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92087c0c745fee6dd8a060c3180c8254e0f23fd0d252b23f3988a3d92890ce64
4
- data.tar.gz: 4ff9742257ffdf393892e293b1548587f552b6bb92fc2484bda6805c27cf1cff
3
+ metadata.gz: 6130eb28e9d379051c5b2f5c83b2c77ca217e82e0ca0aa53736128810fd1ff35
4
+ data.tar.gz: 7359cfb0974a66a0d07bb75899d92c2082a23e326bd6aed56ae5c7790e2819be
5
5
  SHA512:
6
- metadata.gz: 8585bd8ef2918e9a31907b71dfada37f2f4d2755685ff976702bcfa90ec0137afd1b6e71bced5c631f8549188dc62169c8137eb3cf8475b393ec65174a0ac7bc
7
- data.tar.gz: ead3c27d85cae963568e98c53ded6d7199da7ea781b29895eecdd54756af714b154528dc20920b3f8982519d1fd6a2f80c933489844c1d81052cc991b88172d6
6
+ metadata.gz: 0d9e8d398b4f7f412406c23ec13557d4c80f4c10fffbf9563992df2cbbda7c0c9ca46e933025c20930d7434336b63d6485d8cb5463e484e5a04c676d7207a8eb
7
+ data.tar.gz: a34f3b845c73d919b5e502d07f2683e823dd126372cac137eb7c4b504ad4b90f6a25f46f8eb30ef62cba55ef50b7eb3b148d426dcdeabeca87e3465b0622b548
checksums.yaml.gz.sig CHANGED
Binary file
data/.autotest CHANGED
@@ -7,20 +7,20 @@ require 'autotest/rcov' if ENV['RCOV']
7
7
  Autotest.add_hook :initialize do |at|
8
8
  at.extra_files << "../../sexp_processor/dev/lib/pt_testcase.rb"
9
9
  at.libs << ":../../sexp_processor/dev/lib"
10
- at.add_exception "unit"
11
- at.add_exception "coverage"
12
- at.add_exception "coverage.info"
13
10
  at.add_exception ".diff"
11
+ at.add_exception ".rdoc"
12
+ at.add_exception ".yml"
13
+ at.add_exception ".txt"
14
14
  at.add_exception ".output"
15
- at.add_exception "lib/ruby18_parser.rb"
16
- at.add_exception "lib/ruby19_parser.rb"
17
- at.add_exception "lib/ruby20_parser.rb"
18
- at.add_exception "lib/ruby21_parser.rb"
19
- at.add_exception "lib/ruby22_parser.rb"
20
- at.add_exception "lib/ruby20_parser.y"
21
- at.add_exception "lib/ruby21_parser.y"
22
- at.add_exception "lib/ruby22_parser.y"
23
- at.add_exception "lib/ruby_lexer.rex.rb"
15
+ at.add_exception "bin"
16
+ at.add_exception "compare"
17
+ at.add_exception "coverage"
18
+ at.add_exception "coverage.info"
19
+ at.add_exception "misc"
20
+
21
+ Dir["lib/ruby??_parser.{rb,y}"].each do |f|
22
+ at.add_exception f
23
+ end
24
24
 
25
25
  Dir["gauntlet*"].each do |f|
26
26
  at.add_exception f
@@ -30,12 +30,12 @@ Autotest.add_hook :initialize do |at|
30
30
  at.testlib = "minitest/autorun"
31
31
 
32
32
  at.add_mapping(/^lib\/.*\.y$/) do |f, _|
33
- g = File.basename(f, ".y").gsub("_", "_?").gsub(/1[89]|2[012]/, '')
33
+ g = File.basename(f, ".y").gsub("_", "_?").gsub(/2\d/, '')
34
34
  at.files_matching %r%^test/.*#{g}.rb$%
35
35
  end
36
36
 
37
37
  at.add_mapping(/^lib\/.*\.yy$/) do |f, _|
38
- g = File.basename(f, ".yy").gsub("_", "_?").gsub(/1[89]|2[012]/, '')
38
+ g = File.basename(f, ".yy").gsub("_", "_?")
39
39
  at.files_matching %r%^test/.*#{g}.rb$%
40
40
  end
41
41
 
@@ -52,27 +52,16 @@ Autotest.add_hook :initialize do |at|
52
52
  at.files_matching(/test_.*rb$/)
53
53
  end
54
54
 
55
- %w(TestEnvironment TestStackState).each do |klass|
55
+ %w(TestEnvironment TestStackState TestValueExpr).each do |klass|
56
56
  at.extra_class_map[klass] = "test/test_ruby_parser_extras.rb"
57
57
  end
58
58
 
59
- %w(TestRuby18Parser TestRuby19Parser TestRuby20Parser TestRuby21Parser TestRuby22Parser TestRuby23Parser TestParseTree).each do |klass| # HACK
60
- at.extra_class_map[klass] = "test/test_ruby_parser.rb"
59
+ Dir["lib/ruby??_parser.rb"].each do |s|
60
+ n = s[/\d+/]
61
+ at.extra_class_map["TestRubyParserV#{n}"] = "test/test_ruby_parser.rb"
61
62
  end
62
63
  end
63
64
 
64
65
  Autotest.add_hook :run_command do |at, _|
65
66
  system "rake parser lexer DEBUG=1"
66
67
  end
67
-
68
- class Autotest
69
- def ruby
70
- File.expand_path "~/.multiruby/install/1.9.3-p194/bin/ruby"
71
- end
72
- end if ENV["R19"]
73
-
74
- class Autotest
75
- def ruby
76
- File.expand_path "~/.multiruby/install/2.0.0-p195/bin/ruby"
77
- end
78
- end if ENV["R20"]
data/History.rdoc CHANGED
@@ -1,3 +1,315 @@
1
+ === 3.21.0 / 2024-01-15
2
+
3
+ * 18 minor enhancements:
4
+
5
+ * (internal) Added simple RubyLexer#comment.
6
+ * (internal) Removed RubyLexer#comments and #ignore_body_comments.
7
+ * (internal) Removed RubyParser#comments.
8
+ * (internal) Renamed files from lib/ruby##_parser.* to lib/ruby_parser##.*
9
+ * (internal) Renamed lib/ruby3_parser.yy to lib/ruby_parser3.yy
10
+ * (internal) Renamed lib/ruby_parser.yy to lib/ruby_parser2.yy
11
+ * Added tentative 3.2 support. (torrocus)
12
+ * Made `rake compare` a multitask (28s -> 10s!!).
13
+ * Made `rake compare` depend on `generate` (from clean: 28s -> 18s).
14
+ * No longer package versioned .y files.
15
+ * Overhaul of parser/lexer comment processing.
16
+ * Parser productions for k_class/k_module/k_def carry their comment with them.
17
+ * Restructured build tasks to utilize Hoe's .yy support! 8.5s -> 1.2s!!!
18
+ * RubyParser new_(class|module|defn|defs) handle comment processing via sexp.
19
+ * RubyParser new_(class|module|defn|defs) handle normalizing production sexps.
20
+ * RubyParser#next_token clears out lexer's comment when applicable.
21
+ * Simplified parser productions for defn_head, defs_head. No more normalizing.
22
+ * Updated `rake compare` steps for lrama in ruby 3.3+.
23
+
24
+ * 6 bug fixes:
25
+
26
+ * Cleaned out cruft from `rake compare` code.
27
+ * Fixed compare/normalize.rb for lrama differences.
28
+ * Made `parser` task depend on `isolate` task to pick up racc generator.
29
+ * Made racc a runtime dependency (was dev only) now that ruby 3.3 doesn't ship with the racc runtime. (wildmaples)
30
+ * Updated README.rdoc updating instructions to match current filenames.
31
+ * Updated compare versions and added 3.3.
32
+
33
+ === 3.20.3 / 2023-07-11
34
+
35
+ * 2 minor enhancements:
36
+
37
+ * Added Parser#in_argdef and integrated into 3.x parsers.
38
+ * Improved tools/munge.rb to handler MRI 3.2 output
39
+
40
+ * 2 bug fixes:
41
+
42
+ * Fixed process_dots to properly deal with paren-less forward_args. (eric1234)
43
+ * Fixed tools/ripper.rb to properly print ripper sexp at the end
44
+
45
+ === 3.20.2 / 2023-06-06
46
+
47
+ * 1 bug fix:
48
+
49
+ * 3.2: fixed parsing of f(*) and f(**). (agrobbin)
50
+
51
+ === 3.20.1 / 2023-05-16
52
+
53
+ * 1 minor enhancement:
54
+
55
+ * Fixes Sexp#line_max in parser for many constructs: paren_args, arrays of various sorts, calls, classes, modules, etc.
56
+
57
+ === 3.20.0 / 2023-03-04
58
+
59
+ * 1 major enhancement:
60
+
61
+ * Added tentative 3.2 support.
62
+
63
+ * 1 minor enhancement:
64
+
65
+ * Change minimum ruby version to 2.6. (want higher)
66
+
67
+ * 1 bug fix:
68
+
69
+ * Fix up compare tasks for ruby 3.2 differences.
70
+
71
+ === 3.19.2 / 2022-12-03
72
+
73
+ * 5 bug fixes:
74
+
75
+ * Fixed bug parsing array patterns using %w, %i, etc.
76
+ * Fixed dedenting when heredoc has only empty line and interpolation. (mvz)
77
+ * Fixed dsym unescaping. (mvz)
78
+ * Fixed vars in pattern matching that should be lasgn, not lvar.
79
+ * find_pat mid-patterns are now splatted inline, not wrapped in an array_pat.
80
+
81
+ === 3.19.1 / 2022-04-05
82
+
83
+ * 2 bug fixes:
84
+
85
+ * Added comments to endless defn and defs. (mvz)
86
+ * Fixed endless method bug handling attrset names.
87
+
88
+ === 3.19.0 / 2022-03-29
89
+
90
+ * 1 major enhancement:
91
+
92
+ * Added tentative 3.1 support.
93
+
94
+ * 7 minor enhancements:
95
+
96
+ * 3.1: bare RHS assoc: { y: } => s(:hash, s(:lit, :y), nil)
97
+ * 3.1: calls w/ unnamed block args (bare &)
98
+ * 3.1: endless defn/defs w/ paren-less calls (aka commands)
99
+ * 3.1: pattern capture to nonlocal vars, eg: ^@a, ^$b, ^@@c
100
+ * 3.1: pattern: ^(expr) => expr
101
+ * Improved steps for adding new versions.
102
+ * Improved steps for running gauntlets.
103
+
104
+ * 2 bug fixes:
105
+
106
+ * Bumped 2.6+ cached versions for rake compare.
107
+ * Skip test_regexp_esc_C_slash on ruby 3.1.0 because of MRI bug.
108
+
109
+ === 3.18.1 / 2021-11-10
110
+
111
+ * 1 minor enhancement:
112
+
113
+ * All parser tests are now explicitly testing line numbers at every level.
114
+
115
+ * 3 bug fixes:
116
+
117
+ * Fixed endless method with noargs. (mitsuru)
118
+ * Fixed line numbers on some yield forms.
119
+ * Handle and clearly report if unifdef is missing.
120
+
121
+ === 3.18.0 / 2021-10-27
122
+
123
+ Holy crap... 58 commits! 2.7 and 3.0 are feature complete. Strings
124
+ & heredocs have been rewritten.
125
+
126
+ * 9 major enhancements:
127
+
128
+ * !!! Rewrote lexer (and friends) for strings, heredocs, and %*[] constructs.
129
+ * Massive overhaul on line numbers.
130
+ * Freeze input! Finally!!! No more modifying the input string for heredocs.
131
+ * Overhauled RPStringScanner. Removed OLD compatibility methods!
132
+ * Removed Sexp methods: value, to_sym, add, add_all, node_type, values.
133
+ * value moved to sexp_processor.
134
+ * Removed String#grep monkey-patch.
135
+ * Removed String#lineno monkey-patch.
136
+ * Removed string_to_pos, charpos, etc hacks for ancient ruby versions.
137
+ * Removed unread_many... NO! NO EDITING THE INPUT STRING!
138
+
139
+ * 31 minor enhancements:
140
+
141
+ * 2.7/3.0: many more pattern edge cases
142
+ * 2.7: Added `mlhs = rhs rescue expr`
143
+ * 2.7: refactored destructured args (`|(k,v)|`) and unfactored(?!) case_body/args.
144
+ * 3.0: excessed_comma
145
+ * 3.0: finished most everything: endless methods, patterns, etc.
146
+ * 3.0: refactored / added new pattern changes
147
+ * Added RubyLexer#in_heredoc? (ie, is there old_ss ?)
148
+ * Added RubyLexer#old_ss and old_lineno and removed much of SSStack(ish).
149
+ * Added Symbol#end_with? when necessary
150
+ * Added TALLY and DEBUG options for ss.getch and ss.scan
151
+ * Added ignore_body_comments to make parser productions more clear.
152
+ * Added support for no_kwarg (eg `def f(**nil)`).
153
+ * Added support for no_kwarg in blocks (eg `f { |**nil| }`).
154
+ * Augmented generated parser files to have frozen_string_literal comments and fixed tests.
155
+ * Broke out 3.0 parser into its own to ease development.
156
+ * Bumped dependencies on sexp_processor and oedipus_lex.
157
+ * Clean generated 3.x files.
158
+ * Extracted all string scanner methods to their own module.
159
+ * Fixed some precedence decls.
160
+ * Implemented most of pattern matching for 2.7+.
161
+ * Improve lex_state= to report location in verbose debug mode.
162
+ * Made it easier to debug with a particular version of ruby via rake.
163
+ * Make sure ripper uses the same version of ruby we specified.
164
+ * Moved all string/heredoc/etc code to ruby_lexer_strings.rb
165
+ * Remove warning from newer bisons.
166
+ * Sprinkled in some frozen_string_literal, but mostly helped by oedipus bump.
167
+ * Switch to comparing against ruby binary since ripper is buggy.
168
+ * bugs task should try both bug*.rb and bad*.rb.
169
+ * endless methods
170
+ * f_any_kwrest refactoring.
171
+ * refactored defn/defs
172
+
173
+ * 15 bug fixes:
174
+
175
+ * Cleaned a bunch of old hacks. Initializing RubyLexer w/ Parser is cleaner now.
176
+ * Corrected some lex_state errors in process_token_keyword.
177
+ * Fixed ancient ruby2 change (use #lines) in ruby_parse_extract_error.
178
+ * Fixed bug where else without rescue only raises on 2.6+
179
+ * Fixed caller for getch and scan when DEBUG=1
180
+ * Fixed comments in the middle of message cascades.
181
+ * Fixed differences w/ symbol productions against ruby 2.7.
182
+ * Fixed dsym to use string_contents production.
183
+ * Fixed error in bdot2/3 in some edge cases. Fixed p_alt line.
184
+ * Fixed heredoc dedenting in the presence of empty lines. (mvz)
185
+ * Fixed some leading whitespace / comment processing
186
+ * Fixed up how class/module/defn/defs comments were collected.
187
+ * Overhauled ripper.rb to deal with buggy ripper w/ yydebug.
188
+ * Removed dsym from literal.
189
+ * Removed tUBANG lexeme but kept it distinct as a method name (eg: `def !@`).
190
+
191
+ === 3.17.0 / 2021-08-03
192
+
193
+ * 1 minor enhancement:
194
+
195
+ * Added support for arg forwarding (eg `def f(...); m(...); end`) (presidentbeef)
196
+
197
+ === 3.16.0 / 2021-05-15
198
+
199
+ * 1 major enhancement:
200
+
201
+ * Added tentative 3.0 support.
202
+
203
+ * 3 minor enhancements:
204
+
205
+ * Added lexing for "beginless range" (bdots).
206
+ * Added parsing for bdots.
207
+ * Updated rake compare task to download xz files, bumped versions, etc
208
+
209
+ * 4 bug fixes:
210
+
211
+ * Bump rake dependency to >= 10, < 15. (presidentbeef)
212
+ * Bump sexp_processor dependency to 4.15.1+. (pravi)
213
+ * Fixed minor state mismatch at the end of parsing to make diffing a little cleaner.
214
+ * Fixed normalizer to deal with new bison token syntax
215
+
216
+ === 3.15.1 / 2021-01-10
217
+
218
+ * 1 bug fix:
219
+
220
+ * Bumped ruby version to include < 4 (trunk).
221
+
222
+ === 3.15.0 / 2020-08-31
223
+
224
+ * 1 major enhancement:
225
+
226
+ * Added tentative 2.7 support.
227
+
228
+ * 1 minor enhancement:
229
+
230
+ * Improved ruby_parse_extract_error's handling of moving slow files out.
231
+
232
+ * 22 bug fixes:
233
+
234
+ * Bumped ruby version to include 3.0 (trunk).
235
+ * Fix an error related to empty ensure bodies. (presidentbeef)
236
+ * Fix handling of bad magic encoding comment.
237
+ * Fixed SystemStackError when parsing a huoooge hash, caused by a splat arg.
238
+ * Fixed a number of errors parsing do blocks in strange edge cases.
239
+ * Fixed a string backslash lexing bug when the string is an invalid encoding. (nijikon, gmcgibbon)
240
+ * Fixed bug assigning line number to some arg nodes.
241
+ * Fixed bug concatinating string literals with differing encodings.
242
+ * Fixed bug lexing heredoc w/ nasty mix of \r\n and \n.
243
+ * Fixed bug lexing multiple codepoints in \u{0000 1111 2222} forms.
244
+ * Fixed bug setting line numbers in empty xstrings in some contexts.
245
+ * Fixed edge case on call w/ begin + do block as an arg.
246
+ * Fixed handling of UTF BOM.
247
+ * Fixed handling of lexer state across string interpolation braces.
248
+ * Fixed infinite loop when lexing backslash+cr+newline (aka dos-files)
249
+ * Fixed lambda + do block edge case.
250
+ * Fixed lexing of some ?\M... and ?\C... edge cases.
251
+ * Fixed more do/brace block edge case failures.
252
+ * Fixed parsing bug where splat was used in the middle of a list.
253
+ * Fixed parsing of interpolation in heredoc-like strings. (presidentbeef)
254
+ * Fixed parsing some esoteric edge cases in op_asgn.
255
+ * Fixed unicode processing in ident chars so now they better mix.
256
+
257
+ === 3.14.2 / 2020-02-06
258
+
259
+ * 1 minor enhancement:
260
+
261
+ * Cleaned up call_args and removed arg_blk_pass from ruby_parser_extras.rb! Yay!
262
+
263
+ === 3.14.1 / 2019-10-29
264
+
265
+ * 1 minor enhancement:
266
+
267
+ * Declared that ruby_parser supports ruby 2.2 and up.
268
+
269
+ * 3 bug fixes:
270
+
271
+ * Fixed a problem with %W with a null-byte terminator. (wtf?) (spohlenz)
272
+ * Fixed line numbering for command (eg methods without parentheses) arguments. (mvz)
273
+ * Fixed lineno on new dxstrs. (presidentbeef)
274
+
275
+ === 3.14.0 / 2019-09-24
276
+
277
+ * 8 minor enhancements:
278
+
279
+ * Added Sexp#line_min & new line number debugging feature.
280
+ * Allow bin/ruby_parse to use RP_TIMEOUT to tweak default timeout for large files & slow debugging modes.
281
+ * Did you know that custom inspect can't be > 65 chars? 65! Me neither. Fixed.
282
+ * For now, value_expr == remove_begin.
283
+ * Improved error messages for unterminated regexps.
284
+ * Moved all STR_* consts into State::Values and made them State instances.
285
+ * Overhauled RubyLexer::State + Values to allow for completely separate groups of States.
286
+ * RubyParserExtras#remove_begin removes nested begins and patches line numbers.
287
+
288
+ * 22 bug fixes:
289
+
290
+ * Changed EOF signaling to return [false, false] per doco.
291
+ * Changed RubyParserStuff#remove_begin to keep inner line number, if any. (mvz)
292
+ * Differentiated between lambda call and stabby proc. Added :lambda sexp. (whitequark)
293
+ * Extended State#== to check equal? first as an optimization.
294
+ * Fixed a bug in tab indent width.
295
+ * Fixed a line numbering bug for assignables.
296
+ * Fixed a line numbering bug for defns w/ nil bodies.
297
+ * Fixed another missing line number, driven out by ruby_to_ruby bootstrap.
298
+ * Fixed dedenting squiggle heredocs if interpolation is in the mix. (mvz)
299
+ * Fixed differentiation of `{ |a| ... }` vs `{ |a,| ... }`. Fixes #236 (whitequark).
300
+ * Fixed lex_state for symbols.
301
+ * Fixed lex_state for tSTRING_END and tREGEXP_END.
302
+ * Fixed line numbers for BEGIN block. (mvz)
303
+ * Fixed op_asgn1 w/ command_call having array instead of arglist. (mvz)
304
+ * Fixed parsing of () in a command-call (eg p).
305
+ * Fixed remaining missing line numbers by forcing extra checks during test and blowing up. They may still be wrong (esp after heredocs, ugh), but they're there! Special thank you to mvz for pushing on this and providing tests and PRs.
306
+ * Fixed some lex_state versioning issues with closing braces/bracket on ruby<25.
307
+ * Keep carriage return escapes in heredocs. (mvz)
308
+ * Massive overhaul of line number code.
309
+ * More line number fixes and extra tests from mvz. Thank you!
310
+ * Parsing BEGIN block when not at top level should raise an error. (mvz)
311
+ * Removed irb task from Rakefile as it has been pushed up to Hoe and doubles up here.
312
+
1
313
  === 3.13.1 / 2019-03-25
2
314
 
3
315
  * 1 major enhancement:
data/Manifest.txt CHANGED
@@ -7,28 +7,29 @@ bin/ruby_parse
7
7
  bin/ruby_parse_extract_error
8
8
  compare/normalize.rb
9
9
  debugging.md
10
+ gauntlet.md
10
11
  lib/.document
11
12
  lib/rp_extensions.rb
12
13
  lib/rp_stringscanner.rb
13
- lib/ruby20_parser.rb
14
- lib/ruby20_parser.y
15
- lib/ruby21_parser.rb
16
- lib/ruby21_parser.y
17
- lib/ruby22_parser.rb
18
- lib/ruby22_parser.y
19
- lib/ruby23_parser.rb
20
- lib/ruby23_parser.y
21
- lib/ruby24_parser.rb
22
- lib/ruby24_parser.y
23
- lib/ruby25_parser.rb
24
- lib/ruby25_parser.y
25
- lib/ruby26_parser.rb
26
- lib/ruby26_parser.y
27
14
  lib/ruby_lexer.rb
28
15
  lib/ruby_lexer.rex
29
16
  lib/ruby_lexer.rex.rb
17
+ lib/ruby_lexer_strings.rb
30
18
  lib/ruby_parser.rb
31
- lib/ruby_parser.yy
19
+ lib/ruby_parser2.yy
20
+ lib/ruby_parser20.rb
21
+ lib/ruby_parser21.rb
22
+ lib/ruby_parser22.rb
23
+ lib/ruby_parser23.rb
24
+ lib/ruby_parser24.rb
25
+ lib/ruby_parser25.rb
26
+ lib/ruby_parser26.rb
27
+ lib/ruby_parser27.rb
28
+ lib/ruby_parser3.yy
29
+ lib/ruby_parser30.rb
30
+ lib/ruby_parser31.rb
31
+ lib/ruby_parser32.rb
32
+ lib/ruby_parser33.rb
32
33
  lib/ruby_parser_extras.rb
33
34
  test/test_ruby_lexer.rb
34
35
  test/test_ruby_parser.rb
data/README.rdoc CHANGED
@@ -7,9 +7,9 @@ rdoc :: http://docs.seattlerb.org/ruby_parser
7
7
  == DESCRIPTION:
8
8
 
9
9
  ruby_parser (RP) is a ruby parser written in pure ruby (utilizing
10
- racc--which does by default use a C extension). RP's output is
11
- the same as ParseTree's output: s-expressions using ruby's arrays and
12
- base types.
10
+ racc--which does by default use a C extension). It outputs
11
+ s-expressions which can be manipulated and converted back to ruby via
12
+ the ruby2ruby gem.
13
13
 
14
14
  As an example:
15
15
 
@@ -32,6 +32,10 @@ Tested against 801,039 files from the latest of all rubygems (as of 2013-05):
32
32
  * 1.8 parser is at 99.9739% accuracy, 3.651 sigma
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
+ * 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.
35
39
 
36
40
  == FEATURES/PROBLEMS:
37
41
 
@@ -61,15 +65,15 @@ You can also use Ruby19Parser, Ruby18Parser, or RubyParser.for_current_ruby:
61
65
 
62
66
  To add a new version:
63
67
 
64
- * New parser should be generated from lib/ruby_parser.yy.
65
- * Extend lib/ruby_parser.yy with new class name.
66
- * Add new version number to V2 in Rakefile for rule creation.
68
+ * New parser should be generated from lib/ruby_parser[23].yy.
69
+ * Extend lib/ruby_parser[23].yy with new class name.
70
+ * Add new version number to V2/V3 in Rakefile for rule creation.
71
+ * Add new `ruby_parse "x.y.z"` line to Rakefile for rake compare (line ~300).
67
72
  * Require generated parser in lib/ruby_parser.rb.
73
+ * Add new V## = ::Ruby##Parser; end to ruby_parser.rb (bottom of file).
68
74
  * Add empty TestRubyParserShared##Plus module and TestRubyParserV## to test/test_ruby_parser.rb.
69
75
  * Extend Manifest.txt with generated file names.
70
- * Extend sexp_processor's pt_testcase.rb to match version
71
- * add_19tests needs to have the version added
72
- * VER_RE needs to have the regexp expanded
76
+ * Add new version number to sexp_processor's pt_testcase.rb in all_versions.
73
77
 
74
78
  Until all of these are done, you won't have a clean test run.
75
79