From: "kddnewton (Kevin Newton) via ruby-core" Date: 2024-09-24T18:27:26+00:00 Subject: [ruby-core:119287] [Ruby master Feature#20759] No good API to query which parser is being used Issue #20759 has been updated by kddnewton (Kevin Newton). Status changed from Open to Rejected This is on purpose. This should be a transparent change and not visible to the end user. If you need to access the parser API, you can use the `Prism` constant directly, but otherwise it should not be accessible. ---------------------------------------- Feature #20759: No good API to query which parser is being used https://bugs.ruby-lang.org/issues/20759#change-109896 * Author: luke-gru (Luke Gruber) * Status: Rejected ---------------------------------------- Right now the best way I found is: ```ruby parser = RUBY_DESCRIPTION =~ /prism/i ? "prism" : "parse.y" ``` This is useful if you want to invoke a subprocess with the same options given to ruby. ARGV parsing might not work because the option might have been given via RUBYOPT. Maybe `RubyVM::PARSER` could be set to the current parser, and this value could either be a String or Symbol. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/