Project

General

Profile

ActionsLike1

Bug #20044

closed

Add runtime flag and environment variable for prism

Added by HParker (Adam Hess) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:115598]

Description

To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled.

The flags could be,

ruby --prism test.rb

and the environment variable could be,

RUBY_PRISM=1 ruby test.rb

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame (Yusuke Endoh),

  • What to do with the command-line option when prism becomes the default parser in the future.
    ** Just remove it, or leave it as a "do nothing" option?
  • What are the appropriate names.
    ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
  • Whether to print a warning when this mode is used.

Added by HParker (Adam Hess) over 1 year ago

Revision 55326a91

Introduce --parser runtime flag

Introduce runtime flag for specifying the parser,

ruby --parser=prism

also update the description:

$ ruby --parser=prism --version
ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384c9f) +PRISM [x86_64-darwin23]

[Bug #20044]

ActionsLike1

Also available in: Atom PDF