summaryrefslogtreecommitdiff
path: root/lib/prism
diff options
context:
space:
mode:
authorRyan Davis <ryand-ruby@zenspider.com>2025-12-12 13:08:53 -0800
committergit <svn-admin@ruby-lang.org>2025-12-14 16:42:51 +0000
commit4a84fa1b39e1bcd8c62b2b5225535dabcdcfdac4 (patch)
tree9ed5c85add78d80fa8acdcd6136dfa960a105436 /lib/prism
parent674c3d73e0f92d730bd2e544be344585a638ab37 (diff)
[ruby/prism] 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. https://github.com/ruby/prism/commit/df677c324f
Diffstat (limited to 'lib/prism')
-rw-r--r--lib/prism/translation/ruby_parser.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb
index 5149756add..a33ea2306c 100644
--- a/lib/prism/translation/ruby_parser.rb
+++ b/lib/prism/translation/ruby_parser.rb
@@ -2,12 +2,17 @@
# :markup: markdown
begin
- require "ruby_parser"
+ require "sexp"
rescue LoadError
- warn(%q{Error: Unable to load ruby_parser. Add `gem "ruby_parser"` to your Gemfile.})
+ warn(%q{Error: Unable to load sexp. Add `gem "sexp"` to your Gemfile.})
exit(1)
end
+class RubyParser # :nodoc:
+ class SyntaxError < RuntimeError # :nodoc:
+ end
+end
+
module Prism
module Translation
# This module is the entry-point for converting a prism syntax tree into the