From: "mame (Yusuke Endoh) via ruby-core" Date: 2023-12-07T10:33:52+00:00 Subject: [ruby-core:115642] [Ruby master Bug#20044] Add runtime flag and environment variable for prism Issue #20044 has been updated by mame (Yusuke Endoh). Discussed at today's dev meeting. @matz said: * Introduce a command-line option `--parser=prism` and `--parser=parse.y` * If parse.y is removed in the future, `--parser=parse.y` should report an error * Do NOT introduce environment variable * Use `RUBYOPT=--parser=prism` instead * No warning should be printed * Add `+prism` (or `+PRISM` or something) to `RUBY_DESCRIPTION`, like YJIT * This should be removed in the future if prism is the default parser ``` $ ruby --jit --parser=prism -v ruby 3.3.0dev (2023-12-07T02:37:08Z master 214f6d6598) +YJIT +prism [x86_64-linux] ``` ---------------------------------------- Bug #20044: Add runtime flag and environment variable for prism https://bugs.ruby-lang.org/issues/20044#change-105576 * Author: HParker (Adam Hess) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- 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, > * 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. -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/