[Feature #2455] --dump=parsetree, --dump=parsetree_with_comment

Feature #2455: --dump=parsetree, --dump=parsetree_with_comment
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. [email protected]

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.
[email protected] 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

(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

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