ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:120378] [Ruby master Bug#20979] +comment does not affect parsetree without `--parser=parse.y`
@ 2024-12-23 12:48 znz (Kazuhiro NISHIYAMA) via ruby-core
  2024-12-24  4:30 ` [ruby-core:120389] " nobu (Nobuyoshi Nakada) via ruby-core
  0 siblings, 1 reply; 2+ messages in thread
From: znz (Kazuhiro NISHIYAMA) via ruby-core @ 2024-12-23 12:48 UTC (permalink / raw)
  To: ruby-core; +Cc: znz (Kazuhiro NISHIYAMA)

Issue #20979 has been reported by znz (Kazuhiro NISHIYAMA).

----------------------------------------
Bug #20979: +comment does not affect parsetree without `--parser=parse.y`
https://bugs.ruby-lang.org/issues/20979

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Target version: 3.4
* ruby -v: ruby 3.4.0dev (2024-12-23T02:52:14Z master b19fcd02fa) +PRISM [arm64-darwin24]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
`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 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(-)
```



-- 
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:120389] [Ruby master Bug#20979] +comment does not affect parsetree without `--parser=parse.y`
  2024-12-23 12:48 [ruby-core:120378] [Ruby master Bug#20979] +comment does not affect parsetree without `--parser=parse.y` znz (Kazuhiro NISHIYAMA) via ruby-core
@ 2024-12-24  4:30 ` nobu (Nobuyoshi Nakada) via ruby-core
  0 siblings, 0 replies; 2+ messages in thread
From: nobu (Nobuyoshi Nakada) via ruby-core @ 2024-12-24  4:30 UTC (permalink / raw)
  To: ruby-core; +Cc: nobu (Nobuyoshi Nakada)

Issue #20979 has been updated by nobu (Nobuyoshi Nakada).

Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED

https://github.com/ruby/ruby/pull/12450

----------------------------------------
Bug #20979: +comment does not affect parsetree without `--parser=parse.y`
https://bugs.ruby-lang.org/issues/20979#change-111169

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Target version: 3.4
* ruby -v: ruby 3.4.0dev (2024-12-23T02:52:14Z master b19fcd02fa) +PRISM [arm64-darwin24]
* Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED
----------------------------------------
`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(-)
```



-- 
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-24  4:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-23 12:48 [ruby-core:120378] [Ruby master Bug#20979] +comment does not affect parsetree without `--parser=parse.y` znz (Kazuhiro NISHIYAMA) via ruby-core
2024-12-24  4:30 ` [ruby-core:120389] " nobu (Nobuyoshi Nakada) via ruby-core

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).