[ruby-core:120378] [Ruby master Bug#20979] +comment does not affect parsetree without `--parser=parse.y`
From:
"znz (Kazuhiro NISHIYAMA) via ruby-core" <ruby-core@...>
Date:
2024-12-23 12:48:21 UTC
List:
ruby-core #120378
Issue #20979 has been reported by znz (Kazuhiro NISHIYAMA).
----------------------------------------
Bug #20979: +comment does not affect parsetree without `--parser=3Dparse.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 [a=
rm64-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=3Dparse.y`.
If it is intentional, I think more help messages or more explanation somewh=
ere.
=A0
```
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 =3D(ruby --dump=3Dparsetree -e 0) =3D(ruby --d=
ump=3Dparsetree+comment -e 0)
% git diff --no-index --stat =3D(ruby --parser=3Dparse.y --dump=3Dparsetree=
-e 0) =3D(ruby --parser=3Dparse.y --dump=3Dparsetree+comment -e 0)
/tmp/{zshEGciGv =3D> zshWgqfVT} | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
```
--=20
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.rub=
y-lang.org/