
24 Sep
2024
24 Sep
'24
6:17 p.m.
Issue #20759 has been reported by luke-gru (Luke Gruber). ---------------------------------------- Feature #20759: No good API to query which parser is being used https://bugs.ruby-lang.org/issues/20759 * Author: luke-gru (Luke Gruber) * Status: Open ---------------------------------------- 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 used? -- https://bugs.ruby-lang.org/