From: "kddnewton (Kevin Newton) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "kddnewton (Kevin Newton)" <noreply@ruby-lang.org>
Subject: [ruby-core:119288] [Ruby master Feature#20759] No good API to query which parser is being used
Date: Tue, 24 Sep 2024 18:28:31 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-109897.20240924182831.3573@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-20759.20240924181727.3573@ruby-lang.org>
Issue #20759 has been updated by kddnewton (Kevin Newton).
Note that there is another discussion around retrieving command line options given here: https://bugs.ruby-lang.org/issues/6648.
----------------------------------------
Feature #20759: No good API to query which parser is being used
https://bugs.ruby-lang.org/issues/20759#change-109897
* 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/
prev parent reply other threads:[~2024-09-24 18:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 18:17 [ruby-core:119286] " luke-gru (Luke Gruber) via ruby-core
2024-09-24 18:27 ` [ruby-core:119287] " kddnewton (Kevin Newton) via ruby-core
2024-09-24 18:28 ` kddnewton (Kevin Newton) via ruby-core [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-109897.20240924182831.3573@ruby-lang.org \
--to=ruby-core@ml.ruby-lang.org \
--cc=noreply@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).