From df677c324fbd10e9f301d97754eb267d1c21e46c Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Fri, 12 Dec 2025 13:08:53 -0800 Subject: [PATCH] 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. --- lib/prism/translation/ruby_parser.rb | 9 +++++++-- 1 file 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