Skip to content

Commit d23e111

Browse files
committed
- Fixed tools/ripper.rb to properly print ripper sexp at the end
[git-p4: depot-paths = "//src/ruby_parser/dev/": change = 13832]
1 parent 348d03b commit d23e111

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

tools/ripper.rb

+14-12
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ def on_parse_error msg
2121
ARGV.each do |path|
2222
src = path == "-" ? $stdin.read : File.read(path)
2323

24-
sexp = if $b then
25-
Ripper.sexp src
26-
else
27-
rip = MySexpBuilder.new src
28-
rip.yydebug = $d
29-
rip.parse
30-
31-
if rip.error? then
32-
warn "skipping"
33-
next
34-
end
35-
end
24+
sexp = nil
25+
26+
if $b then
27+
sexp = Ripper.sexp src
28+
else
29+
rip = MySexpBuilder.new src
30+
rip.yydebug = $d
31+
sexp = rip.parse
32+
33+
if rip.error? then
34+
warn "skipping"
35+
next
36+
end
37+
end
3638

3739
puts "accept"
3840

0 commit comments

Comments
 (0)