@@ -547,21 +547,25 @@ def self.parse_serialize_file(filepath)
547
547
# which means the files can end up being quite large. We autoload them to make
548
548
# our require speed faster since consuming libraries are unlikely to use all
549
549
# of these features.
550
+ autoload :DesugarVisitor , "yarp/desugar_visitor"
550
551
autoload :Dispatcher , "yarp/dispatcher"
552
+ autoload :MutationVisitor , "yarp/mutation_visitor"
553
+ autoload :RipperCompat , "yarp/ripper_compat"
554
+ autoload :Pack , "yarp/pack"
555
+ autoload :Pattern , "yarp/pattern"
556
+ autoload :Serialize , "yarp/serialize"
551
557
end
552
558
553
559
require_relative "yarp/lex_compat"
554
- require_relative "yarp/mutation_visitor"
555
- require_relative "yarp/desugar_visitor"
556
560
require_relative "yarp/node"
557
- require_relative "yarp/ripper_compat"
558
- require_relative "yarp/serialize"
559
- require_relative "yarp/pack"
560
- require_relative "yarp/pattern"
561
561
562
562
require_relative "yarp/parse_result/comments"
563
563
require_relative "yarp/parse_result/newlines"
564
564
565
+ # This is a Ruby implementation of the YARP parser. If we're running on CRuby
566
+ # and we haven't explicitly set the YARP_FFI_BACKEND environment variable, then
567
+ # it's going to require the built library. Otherwise, it's going to require a
568
+ # module that uses FFI to call into the library.
565
569
if RUBY_ENGINE == "ruby" and !ENV [ "YARP_FFI_BACKEND" ]
566
570
require "yarp/yarp"
567
571
else
0 commit comments