Skip to content

Commit df677c3

Browse files
zenspiderkddnewton
authored andcommitted
Define RubyParser::SyntaxError directly and drop require for ruby_parser.
Had to add a require of sexp since that came in indirectly via ruby_parser.
1 parent 5bf88da commit df677c3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/prism/translation/ruby_parser.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
# :markup: markdown
33

44
begin
5-
require "ruby_parser"
5+
require "sexp"
66
rescue LoadError
7-
warn(%q{Error: Unable to load ruby_parser. Add `gem "ruby_parser"` to your Gemfile.})
7+
warn(%q{Error: Unable to load sexp. Add `gem "sexp"` to your Gemfile.})
88
exit(1)
99
end
1010

11+
class RubyParser # :nodoc:
12+
class SyntaxError < RuntimeError # :nodoc:
13+
end
14+
end
15+
1116
module Prism
1217
module Translation
1318
# This module is the entry-point for converting a prism syntax tree into the

0 commit comments

Comments
 (0)