# \[Feature #2455\] --dump=parsetree, --dump=parsetree\_with\_comment

**URL:** <https://www.ruby-forum.com/t/feature-2455-dump-parsetree-dump-parsetree-with-comment/179905>\
**Category:** Development\
**Created:** [December 7, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/feature-2455-dump-parsetree-dump-parsetree-with-comment/179905 "2009-12-07T19:46:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yusuke\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/f08c70/32.png) [@Yusuke\_E](https://www.ruby-forum.com/u/Yusuke_E)\
**Post date:** [December 7, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/feature-2455-dump-parsetree-dump-parsetree-with-comment/179905/1 "2009-12-07T19:46:49Z")

</div>

Feature #2455: --dump=parsetree, --dump=parsetree\_with\_comment  
[http://redmine.ruby-lang.org/issues/show/2455](http://redmine.ruby-lang.org/issues/show/2455)

e$B5/I\<\<Te(B: Yusuke E.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
e$BC4Ev\<Te(B: Yukihiro M., e$B%+%F%4%je(B: core, Target version:  
1.9.x

e$B1sF#$G$9!#e(B

Ruby e$B$r%G%P%C%0$9$k:]!“e(Bnode  
e$B$N9=B$$r$6$C$HGD0.$7$?$$\>l9g$,$7$P$7$Pe(B  
e$B$”$j$^$9!#e(B  
–dump=insns e$B$K$J$i$C$F!"e(B–dump=parsetree  
e$B$rF~$l$F$b$$$$$G$7$g$&$+!#e(B

$ ./ruby --dump=parsetree -e ‘1 + 2 + 3’  
###############################################

## Do NOT use this node dump for any purpose

## other than debug and research.

###############################################

# @ NODE\_SCOPE (line: 1)

# ± nd\_tbl: (empty)

# ± nd\_args:

# | (null node)

# ± nd\_body:

# @ NODE\_CALL (line: 1)

# ± nd\_mid: :+

# ± nd\_recv:

# | @ NODE\_CALL (line: 1)

# | ± nd\_mid: :+

# | ± nd\_recv:

# | | @ NODE\_LIT (line: 1)

# | | ± nd\_lit: 1

# | ± nd\_args:

# | @ NODE\_ARRAY (line: 1)

# | ± nd\_alen: 1

# | ± nd\_head:

# | | @ NODE\_LIT (line: 1)

# | | ± nd\_lit: 2

# | ± nd\_next:

# | (null node)

# ± nd\_args:

# @ NODE\_ARRAY (line: 1)

# ± nd\_alen: 1

# ± nd\_head:

# | @ NODE\_LIT (line: 1)

# | ± nd\_lit: 3

# ± nd\_next:

# (null node)

$ ./ruby --dump=parsetree\_with\_comment -e ‘1 + 2 + 3’  
###############################################

## Do NOT use this node dump for any purpose

## other than debug and research.

###############################################

# @ NODE\_SCOPE (line: 1)

# | # [nd\_tbl]: local table, [nd\_args]: arguments, [nd\_body]: body

# ± nd\_tbl (local table): (empty)

# ± nd\_args (arguments):

# | (null node)

# ± nd\_body (body):

# @ NODE\_CALL (line: 1)

# | # nd\_mid

# ± nd\_mid (method id): :+

# ± nd\_recv (receiver):

# | @ NODE\_CALL (line: 1)

# | | # nd\_mid

# | ± nd\_mid (method id): :+

# | ± nd\_recv (receiver):

# | | @ NODE\_LIT (line: 1)

# | | | # nd\_lit

# | | ± nd\_lit (literal): 1

# | ± nd\_args (arguments):

# | @ NODE\_ARRAY (line: 1)

# | | # [[nd\_head], [nd\_next]… ] (length: [nd\_alen])

# | ± nd\_alen (length): 1

# | ± nd\_head (element):

# | | @ NODE\_LIT (line: 1)

# | | | # nd\_lit

# | | ± nd\_lit (literal): 2

# | ± nd\_next (next element):

# | (null node)

# ± nd\_args (arguments):

# @ NODE\_ARRAY (line: 1)

# | # [[nd\_head], [nd\_next]… ] (length: [nd\_alen])

# ± nd\_alen (length): 1

# ± nd\_head (element):

# | @ NODE\_LIT (line: 1)

# | | # nd\_lit

# | ± nd\_lit (literal): 3

# ± nd\_next (next element):

# (null node)

Ruby e$B$N%G%P%C%00J30$K$b!"e(BRuby e$B$N%3!\<%I$K=,=O$7$F$$$J$$?M$,e(B  
Ruby e$B$Ne(B  
e$B%3!\<%I$rFI$`:]$N=u$1$K$J$k$H;W$$$^$9!#e(B  
e$B;d$,@Ne(B compile.c e$B$rFI$\_;O$a$F$$$?$3$m$r;W$$=P$9$H!"e(Bnode  
e$B$N9=B$$re(B  
e$BM}2r$7$F$$$J$$$3$H$,Bg$-$J\>c32$K$J$C$F$$$^$7$?!#e(B(e$B%I%-%e%a%s%H$O$J$/!"e(B  
nd\_head, nd\_body e$B$J$I$NL\>A0$,MM!9$J0UL#$GE\>MQ!&MpMQ$5$l$F$$$k$N$Ge(B)

e$B!V%G%P%C%0$H8&5fL\E\*0J30$K;H$&$J!W$HL@\<($9$k$3$H$G!“e(Bnode  
e$B$,Hs8x3+e(B  
API e$B$G$”$k$3$H$r:FEY\<gD%$9$k8z2L$b$"$k$+$b$7$l$^$;$s!#e(B

–  
Yusuke E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Yusuke\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/f08c70/32.png) [@Yusuke\_E](https://www.ruby-forum.com/u/Yusuke_E)\
**Post date:** [December 9, 2009, 8:56am UTC](https://www.ruby-forum.com/t/feature-2455-dump-parsetree-dump-parsetree-with-comment/179905/2 "2009-12-09T08:56:52Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:39853] [Feature #2455] --dump=parsetree,  
–dump=parsetree\_with\_comment”  
on Tue, 8 Dec 2009 03:46:08 +0900, Yusuke E.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|Ruby e$B$r%G%P%C%0$9$k:]!“e(Bnode e$B$N9=B$$r$6$C$HGD0.$7$?$$\>l9g$,$7$P$7$Pe(B  
|e$B$”$j$^$9!#e(B  
|–dump=insns e$B$K$J$i$C$F!"e(B–dump=parsetree e$B$rF~$l$F$b$$$$$G$7$g$&$+!#e(B

e$B:{ED$5$s$,H?BP$7$J$1$l$PF~$l$F$b9=$o$J$$$H;W$$$^$9!#e(B

---

<div class="post-metadata">

**Author:** ![Yusuke\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/f08c70/32.png) [@Yusuke\_E](https://www.ruby-forum.com/u/Yusuke_E)\
**Post date:** [December 9, 2009, 9:00am UTC](https://www.ruby-forum.com/t/feature-2455-dump-parsetree-dump-parsetree-with-comment/179905/3 "2009-12-09T09:00:23Z")

</div>

(2009/12/09 16:56), Yukihiro M. wrote::

> e$B:{ED$5$s$,H?BP$7$J$1$l$PF~$l$F$b9=$o$J$$$H;W$$$^$9!#e(B

e$B!!H?BP$7$^$;$s!%e(B

---

<div class="post-metadata">

**Author:** ![Yusuke\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/f08c70/32.png) [@Yusuke\_E](https://www.ruby-forum.com/u/Yusuke_E)\
**Post date:** [December 9, 2009, 3:07pm UTC](https://www.ruby-forum.com/t/feature-2455-dump-parsetree-dump-parsetree-with-comment/179905/4 "2009-12-09T15:07:21Z")

</div>

e$B%A%1%C%He(B #2455 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r26053.  
Yusuke, thank you for reporting this issue.  
Your contribution to Ruby is greatly appreciated.  
May Ruby be with you.

* * *

[http://redmine.ruby-lang.org/issues/show/2455](http://redmine.ruby-lang.org/issues/show/2455)
