ripper-plus 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -6
- data/lib/ripper-plus/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -119,7 +119,7 @@ Some of these errors are noticed by Ripper, and the offending portion of the syn
|
|
119
119
|
[:var_alias, [:@gvar, "$foo", [1, 6]], [:@backref, "$2", [1, 11]]]]]]
|
120
120
|
# Invalid class name
|
121
121
|
pp Ripper.sexp('class abc; end')
|
122
|
-
|
122
|
+
=> [:program,
|
123
123
|
[[:class,
|
124
124
|
[:const_ref, [:class_name_error, [:@ident, "abc", [1, 6]]]],
|
125
125
|
nil,
|
@@ -130,7 +130,7 @@ The first error, a disallowed alias, results in an `:alias_error` node wrapping
|
|
130
130
|
|
131
131
|
[code]
|
132
132
|
pp Ripper.sexp('def foo(a, @b); end')
|
133
|
-
|
133
|
+
=> [:program,
|
134
134
|
[[:def,
|
135
135
|
[:@ident, "foo", [1, 4]],
|
136
136
|
[:paren,
|
@@ -144,7 +144,7 @@ Worse, some errors are not caught at all:
|
|
144
144
|
|
145
145
|
[code]
|
146
146
|
pp Ripper.sexp('def foo(a, a, a); end')
|
147
|
-
|
147
|
+
=> [:program,
|
148
148
|
[[:def,
|
149
149
|
[:@ident, "foo", [1, 4]],
|
150
150
|
[:paren,
|
@@ -160,7 +160,7 @@ This is very bad. Now every consumer of the Ripper parse tree must check *all me
|
|
160
160
|
|
161
161
|
[code]
|
162
162
|
pp Ripper.sexp('something.each { |a, (b, *c, (d, e), a), f| }')
|
163
|
-
|
163
|
+
=> [:program,
|
164
164
|
[[:method_add_block,
|
165
165
|
[:call,
|
166
166
|
[:var_ref, [:@ident, "something", [1, 0]]], :".",
|
@@ -198,8 +198,6 @@ Overall, Ripper is very complete for a library covered in "EXPERIMENTAL" warning
|
|
198
198
|
|
199
199
|
In the meantime, I'll be using `ripper-plus` in Laser to statically analyze all kinds of stuff about Ruby, but I look forward to the day where I can add `RipperPlus = Ripper if RUBY_VERSION >= MERGED_VERSION` to ripper-plus's main file. `ripper-plus` is O(N), though it's not blazingly fast: it takes about 20-30 ms on my machine to transform the Ripper AST for [the biggest, ugliest Laser code file: the CFG compiler](https://github.com/michaeledgar/laser/blob/master/lib/laser/analysis/control_flow/cfg_builder.rb) to a RipperPlus AST. It takes 50ms for Ripper to parse it in the first place. (That benchmarked transformation is done in-place: `ripper-plus`'s default behavior is to duplicate the Ripper AST.)
|
200
200
|
|
201
|
-
If you have ideas or thoughts, please discuss them on ruby-talk and/or ruby-core! I don't have comments implemented for a reason: I feel it fragments the center of discussion.
|
202
|
-
|
203
201
|
## Contributing to ripper-plus
|
204
202
|
|
205
203
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
data/lib/ripper-plus/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ripper-plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Edgar
|
@@ -98,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
98
|
requirements:
|
99
99
|
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
hash: -
|
101
|
+
hash: -1596603294838898229
|
102
102
|
segments:
|
103
103
|
- 0
|
104
104
|
version: "0"
|