Project

General

Profile

Bug #20979

Updated by znz (Kazuhiro NISHIYAMA) 27 days ago

`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(-) 
 ```

Back