Project

General

Profile

Actions

Bug #20979

closed

+comment does not affect parsetree without `--parser=parse.y`

Added by znz (Kazuhiro NISHIYAMA) 27 days ago. Updated 26 days ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 3.4.0dev (2024-12-23T02:52:14Z master b19fcd02fa) +PRISM [arm64-darwin24]
[ruby-core:120378]

Description

ruby --help says +comment Add comments to AST (affects parsetree)., but it does not affect without --parser=parse.y.

If it is intentional, I think it needs more help messages or more explanation somewhere.
 

Dump List:
  insns           Instruction sequences.
  yydebug         yydebug of yacc parser generator.
  parsetree       Abstract syntax tree (AST).
  -optimize       Disable optimization (affects insns).
  +error-tolerant Error-tolerant parsing (affects yydebug, parsetree).
  +comment        Add comments to AST (affects parsetree).
% git diff --no-index --stat =(ruby --dump=parsetree -e 0) =(ruby --dump=parsetree+comment -e 0)
% git diff --no-index --stat =(ruby --parser=parse.y --dump=parsetree -e 0) =(ruby --parser=parse.y --dump=parsetree+comment -e 0)
 /tmp/{zshEGciGv => zshWgqfVT} | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
Actions #1

Updated by znz (Kazuhiro NISHIYAMA) 27 days ago

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) 26 days ago

  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED
Actions #3

Updated by nobu (Nobuyoshi Nakada) 26 days ago

  • Status changed from Open to Closed

Applied in changeset git|1b0c46daed9186b82ab4fef1a4ab225afe582ee6.


[Bug #20979] [DOC] Add a proviso to +comment option

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0