From 07f49a4d21a99e69621f2d84560bc3d618344649 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 28 Dec 2020 21:31:24 +0200 Subject: [PATCH] refactoring: move internal nodes --- internal/php5/node.go | 85 ++++++ internal/php5/php5.go | Bin 267006 -> 265606 bytes internal/php5/php5.y | 602 +++++++++++++++++++++--------------------- internal/php7/node.go | 99 +++++++ internal/php7/php7.go | Bin 222523 -> 221511 bytes internal/php7/php7.y | 440 +++++++++++++++--------------- pkg/ast/node.go | 94 ------- 7 files changed, 705 insertions(+), 615 deletions(-) create mode 100644 internal/php5/node.go create mode 100644 internal/php7/node.go diff --git a/internal/php5/node.go b/internal/php5/node.go new file mode 100644 index 0000000..6a612ac --- /dev/null +++ b/internal/php5/node.go @@ -0,0 +1,85 @@ +package php5 + +import ( + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" +) + +type ParserBrackets struct { + Position *position.Position + OpenBracketTkn *token.Token + Child ast.Vertex + CloseBracketTkn *token.Token +} + +func (n *ParserBrackets) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserBrackets) GetPosition() *position.Position { + return n.Position +} + +type ParserSeparatedList struct { + Position *position.Position + Items []ast.Vertex + SeparatorTkns []*token.Token +} + +func (n *ParserSeparatedList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserSeparatedList) GetPosition() *position.Position { + return n.Position +} + +// TraitAdaptationList node +type TraitAdaptationList struct { + Position *position.Position + OpenCurlyBracketTkn *token.Token + Adaptations []ast.Vertex + CloseCurlyBracketTkn *token.Token +} + +func (n *TraitAdaptationList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitAdaptationList) GetPosition() *position.Position { + return n.Position +} + +// ArgumentList node +type ArgumentList struct { + Position *position.Position + OpenParenthesisTkn *token.Token + Arguments []ast.Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token +} + +func (n *ArgumentList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ArgumentList) GetPosition() *position.Position { + return n.Position +} + +// TraitMethodRef node +type TraitMethodRef struct { + Position *position.Position + Trait ast.Vertex + DoubleColonTkn *token.Token + Method ast.Vertex +} + +func (n *TraitMethodRef) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitMethodRef) GetPosition() *position.Position { + return n.Position +} diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a65a4c86b8b6110e0454d39af0d3a8041ac5b829..f93f178b08a189954f823aaf5bf7b5d3b0aa0eb0 100644 GIT binary patch delta 3974 zcmb7Hdr*|u6`yks6j&CP$XXFF3xojD0LrR_*8&A0K9H@}MjINTsr7+UOkx#d433%9 z$@rRxoFr{b$g8%~CNed>)9GZ2P10JTLWri(P81U-X=-9Luf{moo_oJ#7Yy#=f8X8n zxW9YO?>zR(b8!#-GOq0aY<6+yWys>^K9qj!KB< zi#3p>cBVmOICm965fAL52+GaM)`CJlp93~NSPpq=aTaWc;41sF!AsgMg>Q7r9c49S zjI+2|A2+=Vk=$|?#;K=r;RN^<)Aa>LXPQc#`b~)v>r=rWz&S+_!`?w~^M)DlBmMX~ z&Mtsg^kcVb)K&VrN^bl)6>)VT9MZ=mZPqqSDmcp21I6%H0apO2eCKS~am^=dSL&b# zR$ntJO8jjZBk+7)Qweukz|*R(0o+p^1UL)ucX{zF7#J(~Kg|gSzUzmO3Vd=N{5U9g z{Gre172cs2B!2H2FPO0)$P3iZ7G6i_yB38&pPS5`$MHs9{TM{CYduWh)OC=_jq9PB zA6X~Q8X@&)!M>5dP2f4LmPL(vxfOOuRrws&Xze`y&pL?Z9gjkc!pGtHL_ei(;POri z|A;o8ual%Xn0E3u05jS?qzFNFKuS; z5*W`Z(=nP`u2405zeEQgwWHI7kG+480OZ;5cj~kaTi_d3Hg0=ba=hySis#x4isQad zg#mGgAXZ(nV-;{kEOzl5S1^fNQgD*~O6I;&%;wZ+n!vjq@|%1msKX9in&3~WgIhe( zFo&9zgO8jPw|hUQ7{0Iq?CMw+9trbnTNLPUP!#93qG_q>Vh;X35c7b)OmFTyA zxDj-~yqu7aV@~RC-B<@|a2mFUTb%l15#Ge_6rqP*#aP2Di}9y^SaI9{0?AcjwdPFC zrWmd(!6nwkSUTp5x!ogHkrh&6``a;vy}6X8ZZDH3D*3S!0}xbE6_yM;vz(Xng>7h8 z_toIP9Krc<^bUzl>mpo+A@z3aNBG9x6ZLp22F@&J5BIg>WNsKw5f-6q(=}RmBi0($ z`*{283OpVBs-ba{&-7(a<7dt_|NyFtK%c7ePPigUNi^d*o!n#6D^hR z%^(-=S}W4FO<2hLzM^s5upPtH$7^vp>O@W99Jlaa6HWE3$G?a9y-ptK(c!1oFxO4T zq{E2oNw@26HA^?D48G+AX7Yd%me#z5%@UU5SjOiL$Z*$UCE|=&KS$D8nnAt#`U6Z4 zu+=xtMe<$VSwo5HZy(|pKJn>u_#F%GjE``Bh%{aJ6bsdhpWuSvdP?+WTlrH>U*Jk# zD&;eo)4syjG+HyjrNdsr4I`&`9@pjwExY4{<&u%Az*Zv}DGr<@A!XdV3T&$3GIp3j zp2p4PbdQyWB_Q@grQ-A19BcWUr&BRg$9)!y@iaC6f4JQ8uxEhg_#HTPV0^YQC6aZG zXNVld=EI;cj4+PQBW(q(cGVSGd^(!4ImS+B)vvxqzZgwtnyQQnX061!2}g16R_q|R zaTz*V`oV7X;SDq(1kj7p`FOHsfL{DeUyEXgOgjB`(_-wr-AV6Q$~(u?8b8-Y>qmCp z^lf_2QkE4glT$WJ6R)e3b}mUb%cU_hz1Zh|UIKNG8B71f>%j6#(sg1{yC;#`u6icZ zlkwbHMpJojDJ>pGP_u-->Y)=_`fDv1opeTTS%sxHmFI4tjYjz@ewjt|-<4DwDAsf( zb=np<4=Y|J#oLuL8ZIS{;${AX!c@ZLt@KaJLl8_Q>fn7;8KFC{>8rb~mU^aNcrB#4 z`Y*`d2dN`?N8s{@WqGgPN?!(V&Z73Hzwc-B{!$3+cnwflXT&P~1YN;*S|&o4H@o2-thLYu#SxRXC@a) z{)$cs5g&b_ia13jV*$2uV6+=&a(4{Hs*PtT*=$lK%?3{x_wAM5Aqzl(n)e=^o9OQ) kflbYHV_DLwRqr4TMrq)6?1~Iq8ax92ysECKu-d5q17AgW!2kdN delta 5235 zcmbtYYfx2H6rQy<30%2Eg7PZhf+8tgK+?Du1X0wn1X0Vf9Lrv2=>$HYBo(vlF_ku! z%gQmEv6>!AR@0vB0jX0NrldVBg(iD2(}<>-<|M6q_CDu6BDk0SopbhD`&*B1ueHuz z{cOzn7h)RTf|aQhgBULFPlZIJ<^l*K$i{S9n}QB1>%cBpPY9HJGEz`UCwvHw|Z+1p)0Ixu>KGX4!L@5m!1+$HS z(W$dAnGTGCU1|dkgM((5!(8jN+=|yYjZw#*9VvuQtc7IHrgq9L#V9)D>P6Q{nL`MC88Y*B3Rg}Ta+W1~cp#t>TSib-* z9T#eVR*&yKcvAa26Kh%{E^whi!Nk^<$Ll1~jAMHoGk zgEp#6!EoA75bmjtqiOB0{H>*v&u(Hi+dnZI2T(%?*TBbZ!Y)hRg5_}v#V8AhKY5FqAr5Sns~mB9X?-f#LFxJz(=5R|loFz$_o-jV+MvuRPzXM-}wyUbrPB zUdrr!FkM$(j(r?e?h#Ei?EoBAAbzDahZ=vzfmGdwiSo;Xuq{F%ADxLV+4Md1>!E*4 zZG&Q~?4`-AZLm90X)itt%PbGJhi3fFa{y74cR3ShO*BT(&bg4fekrEW>)Rod@*?mT z!wVT7iPhjQmm;^?aJTQrd!q1V1;6qfCaVU>PZzJ>C*rC4c8pbvo9%d+db-gr669}o zyfs0^YHB8qwNjHMxoMpbv!bZURMlTZQsZz`-Ayu?w(4a2X%D4%CyrFcPj=$HU`42c z67n#_96z0pRmxM@F#@0THf{%PD#Q%s&4-0pqWvnziRx*B3vaVL$fIMmYV zYo`o1-r!^50e6TN()41yQRSz(1XHNB70cv+(YQ@p%^#oFcl(gDJCUq^vRH{Cz`9w^~OQ?P!>iWX;bY6BeM-w2`OJXunvaBT6 z)Oi4NEvR(KrT+!=srX%AVy?H?%c`$%ShN!FrU1SD6PD;h!>a+qVvgh*HCQ{y6)lZU z{))pb=qx#*1E&R_)%H$yrtvqN9<+*Nl`B;GY4<6dAQ%0Pm6{Ix-d}T+O*5uH8@<-b z^}i`f*r@a@M$-Ipn5ihjy`#Gs(n){60fQ)J2MaIv%-x)#ay5Z-c635HC#95f#^l8@ zyC{&?pTV2Goh6;x&*CB#7$!pgzfL#L?>lkskZYwAygYkK9E*T!$_{xMf}Vu!alH!YnF^5W|!S`OPAURz!$T zWr7e7hO|wA+;)NZf5?)Nr)tUuXZvNcy}uaYwX>J}OHN3v$>12F|3|pv6w(K7uvrz! zDCbf1PK-FL;=)sO1|1qC?ozLO-2Sr*MA4=J;zuR7GFIH_uVJP-8#TsFaiUq{_HNLj zfqgQlDL#0E@{LukLS`&o897D<+h=bQzByMl_F7VeGB5u zxv5}u;4Y8)Y|zswa?35HqC&Hxo5Jat+>+!IWn!>bCa`>ZM!Z~k^*BK}mbVV-)%jv_ zEfil{b~>m}&KJ|(#eus7h{`%42=&T5PDeRJC~8P^*iQORUJmt{?+27^1)o-)_#g7 z+KoJR?T^NIdF?}DRI)-dYUArQ+%=3l8>19^UmaV-B(=aNe}vq)MLebSBv(3fIC*}j zs1ZTi&eO7acyG^QLB`ijR)gEv1<((x|>vloyg;v|ih>0gOQLbFuv{zepqq_V+F7RfAHr+*Sm zt21crb{>C@|G_tROTOn)w00R!47q6#D^re$rbKmExlH)}ns~b{kAxFwO_xZL51bJ{ XMtW0EJU-qUbVxlztaOEiRYd*+iej$p diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 581d612..54e00b5 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -291,7 +291,7 @@ top_statement_list: namespace_name: T_STRING { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.NameNamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -309,8 +309,8 @@ namespace_name: Value: $3.Value, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, part) $$ = $1 } @@ -350,9 +350,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -363,9 +363,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracketTkn: $3, Stmts: $4, @@ -387,8 +387,8 @@ top_statement: $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), UseTkn: $1, - UseDeclarations: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -402,8 +402,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -417,8 +417,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -433,14 +433,14 @@ top_statement: use_declarations: use_declarations ',' use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -450,22 +450,22 @@ use_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -478,12 +478,12 @@ use_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -493,9 +493,9 @@ use_declaration: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -510,14 +510,14 @@ use_declaration: use_function_declarations: use_function_declarations ',' use_function_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_function_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -527,22 +527,22 @@ use_function_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -555,12 +555,12 @@ use_function_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -570,9 +570,9 @@ use_function_declaration: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -587,14 +587,14 @@ use_function_declaration: use_const_declarations: use_const_declarations ',' use_const_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_const_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -604,22 +604,22 @@ use_const_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -632,12 +632,12 @@ use_const_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -647,9 +647,9 @@ use_const_declaration: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -841,14 +841,14 @@ unticked_statement: { $9.(*ast.StmtFor).ForTkn = $1 $9.(*ast.StmtFor).OpenParenthesisTkn = $2 - $9.(*ast.StmtFor).Init = $3.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Init = $3.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).InitSemiColonTkn = $4 - $9.(*ast.StmtFor).Cond = $5.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Cond = $5.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CondSemiColonTkn = $6 - $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Loop = $7.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 $9.(*ast.StmtFor).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) @@ -1046,8 +1046,8 @@ unticked_statement: { $5.(*ast.StmtDeclare).DeclareTkn = $1 $5.(*ast.StmtDeclare).OpenParenthesisTkn = $2 - $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items - $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $5.(*ast.StmtDeclare).Consts = $3.(*ParserSeparatedList).Items + $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 $5.(*ast.StmtDeclare).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) @@ -1265,8 +1265,8 @@ unticked_function_declaration_statement: Value: $3.Value, }, OpenParenthesisTkn: $4, - Params: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $6, OpenCurlyBracketTkn: $7, Stmts: $8, @@ -1427,10 +1427,10 @@ interface_extends_list: | T_EXTENDS interface_list { $$ = &ast.StmtInterface{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ExtendsTkn: $1, - Extends: $2.(*ast.ParserSeparatedList).Items, - ExtendsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Extends: $2.(*ParserSeparatedList).Items, + ExtendsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1443,10 +1443,10 @@ implements_list: | T_IMPLEMENTS interface_list { $$ = &ast.StmtClass{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ImplementsTkn: $1, - Implements: $2.(*ast.ParserSeparatedList).Items, - ImplementsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Implements: $2.(*ParserSeparatedList).Items, + ImplementsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1454,14 +1454,14 @@ implements_list: interface_list: fully_qualified_class_name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | interface_list ',' fully_qualified_class_name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -1496,7 +1496,7 @@ foreach_variable: } | T_LIST '(' assignment_list ')' { - pairList := $3.(*ast.ParserSeparatedList) + pairList := $3.(*ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { @@ -1507,8 +1507,8 @@ foreach_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -1588,7 +1588,7 @@ declare_statement: declare_list: T_STRING '=' static_scalar { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtConstant{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), @@ -1605,9 +1605,9 @@ declare_list: } | declare_list ',' T_STRING '=' static_scalar { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append( - $1.(*ast.ParserSeparatedList).Items, + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append( + $1.(*ParserSeparatedList).Items, &ast.StmtConstant{ Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ @@ -1818,21 +1818,21 @@ parameter_list: } | /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } ; non_empty_parameter_list: parameter { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | non_empty_parameter_list ',' parameter { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -1927,7 +1927,7 @@ optional_class_type: function_call_parameter_list: '(' ')' { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, @@ -1935,7 +1935,7 @@ function_call_parameter_list: } | '(' non_empty_function_call_parameter_list ')' { - argumentList := $2.(*ast.ArgumentList) + argumentList := $2.(*ArgumentList) argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) argumentList.OpenParenthesisTkn = $1 argumentList.CloseParenthesisTkn = $3 @@ -1944,7 +1944,7 @@ function_call_parameter_list: } | '(' yield_expr ')' { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Arguments: []ast.Vertex{ @@ -1962,14 +1962,14 @@ function_call_parameter_list: non_empty_function_call_parameter_list: function_call_parameter { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Arguments: []ast.Vertex{$1}, } } | non_empty_function_call_parameter_list ',' function_call_parameter { - $1.(*ast.ArgumentList).SeparatorTkns = append($1.(*ast.ArgumentList).SeparatorTkns, $2) - $1.(*ast.ArgumentList).Arguments = append($1.(*ast.ArgumentList).Arguments, $3) + $1.(*ArgumentList).SeparatorTkns = append($1.(*ArgumentList).SeparatorTkns, $2) + $1.(*ArgumentList).Arguments = append($1.(*ArgumentList).Arguments, $3) $$ = $1 } @@ -2154,8 +2154,8 @@ class_statement: $$ = &ast.StmtPropertyList{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $3), Modifiers: $1, - Properties: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Properties: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -2187,8 +2187,8 @@ class_statement: Value: $4.Value, }, OpenParenthesisTkn: $5, - Params: $6.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $6.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $6.(*ParserSeparatedList).Items, + SeparatorTkns: $6.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $7, Stmt: $8, } @@ -2201,12 +2201,12 @@ trait_use_statement: traitUse := &ast.StmtTraitUse{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, - Traits: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Traits: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } switch n := $3.(type) { - case *ast.TraitAdaptationList : + case *TraitAdaptationList : traitUse.OpenCurlyBracketTkn = n.OpenCurlyBracketTkn traitUse.Adaptations = n.Adaptations traitUse.CloseCurlyBracketTkn = n.CloseCurlyBracketTkn @@ -2221,14 +2221,14 @@ trait_use_statement: trait_list: fully_qualified_class_name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | trait_list ',' fully_qualified_class_name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -2244,7 +2244,7 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.TraitAdaptationList{ + $$ = &TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, Adaptations: $2, @@ -2294,13 +2294,13 @@ trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { $$ = &ast.StmtTraitUsePrecedence{ - Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ParserSeparatedList).Items), + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, InsteadofTkn: $2, - Insteadof: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Insteadof: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -2308,14 +2308,14 @@ trait_precedence: trait_reference_list: fully_qualified_class_name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | trait_reference_list ',' fully_qualified_class_name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -2324,7 +2324,7 @@ trait_reference_list: trait_method_reference: T_STRING { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2342,7 +2342,7 @@ trait_method_reference: trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, @@ -2360,9 +2360,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ @@ -2376,9 +2376,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, } @@ -2520,8 +2520,8 @@ class_variable_declaration: }, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, item) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, item) $$ = $1 } @@ -2541,14 +2541,14 @@ class_variable_declaration: Expr: $5, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, item) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, item) $$ = $1 } | T_VARIABLE { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2567,7 +2567,7 @@ class_variable_declaration: } | T_VARIABLE '=' static_scalar { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), @@ -2647,7 +2647,7 @@ echo_expr_list: for_expr: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_for_expr { @@ -2658,14 +2658,14 @@ for_expr: non_empty_for_expr: non_empty_for_expr ',' expr { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2743,10 +2743,10 @@ new_expr: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, - OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ast.ArgumentList).Arguments, - SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ArgumentList).Arguments, + SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } } else { $$ = &ast.ExprNew{ @@ -2766,8 +2766,8 @@ expr_without_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, EqualTkn: $5, @@ -2801,10 +2801,10 @@ expr_without_variable: Position: yylex.(*Parser).builder.NewTokenNodePosition($4, $6), NewTkn: $4, Class: $5, - OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $6.(*ast.ArgumentList).Arguments, - SeparatorTkns: $6.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $6.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $6.(*ArgumentList).OpenParenthesisTkn, + Arguments: $6.(*ArgumentList).Arguments, + SeparatorTkns: $6.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $6.(*ArgumentList).CloseParenthesisTkn, } } else { _new = &ast.ExprNew{ @@ -3427,8 +3427,8 @@ expr_without_variable: closure.FunctionTkn = $1 closure.AmpersandTkn = $2 closure.OpenParenthesisTkn = $3 - closure.Params = $4.(*ast.ParserSeparatedList).Items - closure.SeparatorTkns = $4.(*ast.ParserSeparatedList).SeparatorTkns + closure.Params = $4.(*ParserSeparatedList).Items + closure.SeparatorTkns = $4.(*ParserSeparatedList).SeparatorTkns closure.CloseParenthesisTkn = $5 closure.OpenCurlyBracketTkn = $7 closure.Stmts = $8 @@ -3445,8 +3445,8 @@ expr_without_variable: closure.FunctionTkn = $2 closure.AmpersandTkn = $3 closure.OpenParenthesisTkn = $4 - closure.Params = $5.(*ast.ParserSeparatedList).Items - closure.SeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + closure.Params = $5.(*ParserSeparatedList).Items + closure.SeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns closure.CloseParenthesisTkn = $6 closure.OpenCurlyBracketTkn = $8 closure.Stmts = $9 @@ -3549,8 +3549,8 @@ combined_scalar: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -3559,8 +3559,8 @@ combined_scalar: $$ = &ast.ExprArray{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -3583,8 +3583,8 @@ lexical_vars: $$ = &ast.ExprClosure{ UseTkn: $1, UseOpenParenthesisTkn: $2, - Use: $3.(*ast.ParserSeparatedList).Items, - UseSeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Use: $3.(*ParserSeparatedList).Items, + UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, UseCloseParenthesisTkn: $4, } } @@ -3605,8 +3605,8 @@ lexical_var_list: }, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, variable) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, variable) $$ = $1 } @@ -3625,8 +3625,8 @@ lexical_var_list: }, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, variable) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, variable) $$ = $1 } @@ -3644,7 +3644,7 @@ lexical_var_list: }, } - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ variable }, } } @@ -3663,7 +3663,7 @@ lexical_var_list: }, } - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ variable }, } } @@ -3673,16 +3673,16 @@ function_call: namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), + Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ParserSeparatedList).Items, $2), Function: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -3690,16 +3690,16 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), Function: &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } } | T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -3707,15 +3707,15 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Function: &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, - OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ast.ArgumentList).Arguments, - SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ArgumentList).Arguments, + SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list @@ -3725,13 +3725,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3746,10 +3746,10 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list @@ -3759,13 +3759,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3780,10 +3780,10 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } } | variable_without_objects function_call_parameter_list @@ -3791,10 +3791,10 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } ; @@ -3811,28 +3811,28 @@ class_name: | namespace_name { $$ = &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -3841,28 +3841,28 @@ fully_qualified_class_name: namespace_name { $$ = &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -3984,7 +3984,7 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = &ast.ArgumentList{} + $$ = &ArgumentList{} } | function_call_parameter_list { @@ -4133,36 +4133,36 @@ static_scalar_value: | namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Const: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), Const: &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -4172,8 +4172,8 @@ static_scalar_value: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -4182,8 +4182,8 @@ static_scalar_value: $$ = &ast.ExprArray{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -4513,36 +4513,36 @@ general_constant: | namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Const: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), Const: &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -4603,13 +4603,13 @@ scalar: static_array_pair_list: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_static_array_pair_list possible_comma { if $2 != nil { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, &ast.ExprArrayItem{}) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, &ast.ExprArrayItem{}) } $$ = $1 @@ -4637,8 +4637,8 @@ non_empty_static_array_pair_list: Val: $5, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } @@ -4649,14 +4649,14 @@ non_empty_static_array_pair_list: Val: $3, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), @@ -4669,7 +4669,7 @@ non_empty_static_array_pair_list: } | static_scalar_value { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodePosition($1), @@ -4895,10 +4895,10 @@ method: { $$ = &ast.ExprMethodCall{ Position: yylex.(*Parser).builder.NewNodePosition($1), - OpenParenthesisTkn: $1.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $1.(*ast.ArgumentList).Arguments, - SeparatorTkns: $1.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $1.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $1.(*ArgumentList).OpenParenthesisTkn, + Arguments: $1.(*ArgumentList).Arguments, + SeparatorTkns: $1.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $1.(*ArgumentList).CloseParenthesisTkn, } } ; @@ -5135,7 +5135,7 @@ object_dim_list: Property: $1, } - if brackets, ok := $1.(*ast.ParserBrackets); ok { + if brackets, ok := $1.(*ParserBrackets); ok { property.OpenCurlyBracketTkn = brackets.OpenBracketTkn property.Property = brackets.Child property.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -5156,7 +5156,7 @@ variable_name: } | '{' expr '}' { - $$ = &ast.ParserBrackets{ + $$ = &ParserBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, @@ -5187,14 +5187,14 @@ simple_indirect_reference: assignment_list: assignment_list ',' assignment_list_element { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | assignment_list_element { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -5211,7 +5211,7 @@ assignment_list_element: } | T_LIST '(' assignment_list ')' { - pairList := $3.(*ast.ParserSeparatedList) + pairList := $3.(*ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { @@ -5224,8 +5224,8 @@ assignment_list_element: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, } @@ -5240,13 +5240,13 @@ assignment_list_element: array_pair_list: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_array_pair_list possible_comma { if $2 != nil { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, &ast.ExprArrayItem{}) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, &ast.ExprArrayItem{}) } $$ = $1 @@ -5263,8 +5263,8 @@ non_empty_array_pair_list: Val: $5, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } @@ -5275,14 +5275,14 @@ non_empty_array_pair_list: Val: $3, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } | expr T_DOUBLE_ARROW expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), @@ -5295,7 +5295,7 @@ non_empty_array_pair_list: } | expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodePosition($1), @@ -5314,8 +5314,8 @@ non_empty_array_pair_list: Val: $6, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } @@ -5327,14 +5327,14 @@ non_empty_array_pair_list: Val: $4, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } | expr T_DOUBLE_ARROW '&' w_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), @@ -5348,7 +5348,7 @@ non_empty_array_pair_list: } | '&' w_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), @@ -5537,8 +5537,8 @@ internal_functions_in_yacc: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), IssetTkn: $1, OpenParenthesisTkn: $2, - Vars: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Vars: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $4, } } @@ -5609,14 +5609,14 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | isset_variables ',' isset_variable { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } diff --git a/internal/php7/node.go b/internal/php7/node.go new file mode 100644 index 0000000..dfb0236 --- /dev/null +++ b/internal/php7/node.go @@ -0,0 +1,99 @@ +package php7 + +import ( + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" +) + +type ParserBrackets struct { + Position *position.Position + OpenBracketTkn *token.Token + Child ast.Vertex + CloseBracketTkn *token.Token +} + +func (n *ParserBrackets) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserBrackets) GetPosition() *position.Position { + return n.Position +} + +type ParserSeparatedList struct { + Position *position.Position + Items []ast.Vertex + SeparatorTkns []*token.Token +} + +func (n *ParserSeparatedList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserSeparatedList) GetPosition() *position.Position { + return n.Position +} + +// TraitAdaptationList node +type TraitAdaptationList struct { + Position *position.Position + OpenCurlyBracketTkn *token.Token + Adaptations []ast.Vertex + CloseCurlyBracketTkn *token.Token +} + +func (n *TraitAdaptationList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitAdaptationList) GetPosition() *position.Position { + return n.Position +} + +// ArgumentList node +type ArgumentList struct { + Position *position.Position + OpenParenthesisTkn *token.Token + Arguments []ast.Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token +} + +func (n *ArgumentList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ArgumentList) GetPosition() *position.Position { + return n.Position +} + +type ReturnType struct { + Position *position.Position + ColonTkn *token.Token + Type ast.Vertex +} + +func (n *ReturnType) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ReturnType) GetPosition() *position.Position { + return n.Position +} + +// TraitMethodRef node +type TraitMethodRef struct { + Position *position.Position + Trait ast.Vertex + DoubleColonTkn *token.Token + Method ast.Vertex +} + +func (n *TraitMethodRef) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitMethodRef) GetPosition() *position.Position { + return n.Position +} diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 8c4c775da8b45637d7cae76a854812cd6a982fd1..9810e30bd7d4cfe13636d6e9b9ddf654e0d8054f 100644 GIT binary patch delta 3012 zcmcgueN5DK7~k{!ju(kLVc>zDyc`G|3fz&Nim4pp)F3@jLNS3vS?SVjt@$#SE^CuE z2082Lj{<6K<`!?Q?ODTo!-hsV++1e946WvxZ&exD2J2U6LB03H$V(sc@%P}yB}idYCc?0!TVH5X^`WL6Rs#nCY^V| z66GzTy29XGZZCvW5k{rq$0bl=(kZ1#i!&;Ds*PwTPn`|T5Jn(<-Un&awj3orFZytb;Bm${ybsgk&1t1+iRI0!zS%dGQ(s#jvRq z7U>=z5dQY`C6ZNDvs%K;w-&;us4#X@L4|BV2YN#VyrP!1QQUg5B~`+9V?(kXjT#%DhZvR`PltifG8#Gn(bO>qB57WkAk^}) zV71u;@$`v8?e=UfW^BzE!zP6r=sB;y=6|)X_Wy57EL-{@)F`+XVKGfz4fSezymWCj ztPe3fdd8+T{*1KR@G^Spd>PzO51Y`S#!qYEsn8@Tptp;(SaPg`QvrhQ4xQ%Y<&9v` z!r4yq27hzK8==&!)}BNiTcKP{PzF7+1E!FBn-IkBm_p~bi9qH(PI(+^!^{O$s_pMsyW>76RH)4UM_&mrt*cI04@z_&(~%`hrmoX%-UXdm^ABfsY5P;WB2sWKB2__t(y$YcN_ zLS>=*lYb*eTdze5&MVL#o zyrN*;y`sB4h-SK#f%PmQohIXe?>aG)w&de{s&nCDs+=a6{OG_k)vIw+ad$4p!)Odk zj19+rCj(D#q81dTRx0HiF1+`kk;Irqt>x0p_32no^)oS*hHuFI({mFuxN8P>0*mn* zOX#s{*8$?p#dz5iI@&|drBYB~%2$_SU!)@1@8RT~t`^iJZx>K!EoM{P*FxpntK{la zgrU?Lp^DI{jN5B4#-w7r0Z$~Q)X6!B+fJK{v`BgtaUwktFPDf!=kSp_9MWe+zt(MZ zWPvbJQBFnMIBgwjs7}M@9`Xdc>DilL;iHXsyEY&YCOXrP)6^0flyL%UY0nAt@W2VI z(${g3Ffciw2-$RaK-v@XEnwl@MWpya)J4lddk0a!Z2smQq)U0#7x<)t)yq+*u_+>e zQ7U;BO1FNDY;^QXc^v6Bfnz3h49e%`v%+{mBAY5MqlJ6U;@(k|9b=Od6pVUaES+8s zQAS?bIn3i7=kOT}R1Q0jB=1{}y@(Hw7X4>!v$SoE;*Hk7-k3|vR z%>H*hPvSlCTEE6+6SO=t@5s>H5!5wRyU)E2?H;iFy{5}^B6sF#1^P=X)G0>0G~X%q zxwQGw0nTL^0w`>Z3MS%Mo|5o1k(x_13+K$$ezB>ka?_e7Iez_V*W3i-sig|6)X{<_ jI=o7|8zhHYtUftpxubSP>s%sSr!|Hi&SKiXUOVsykF>d& delta 4235 zcmc&%TTGN!5YEiMTo%}M6~O|sfXGc@7pNF3C={%U7(~Ra6jY!RNVQg41urpZq7S`9 zt+9^2RGTJh6K`#_rx6KYQ4C6|QCmx@Vl<}JR&X}4yO`A@DHHo5aV4%mT5KJw}O1LOUf?lBGpYvv2K4wd5a{;8#jv9!TOXd!z zPZwaMzKo!-WO%GE!)bpi_|e1^7^m;q=~yKjQ8icQLjskhfr-9Nfo?kY0Xy{cmzb|FJ(vZnzviQ#XdYP>Lae?QP5UY#jCx;z0J+CT>}1>n zsUma=EC!wN*@fqxf+(7vub9bt2%^NAsnDhQaQOhF(W)v8)=edfqdBlav*J27lI1SC z-AN?o2^Yt5A=B-S8cAb+zg5N&bmJlzo%T)C^Ct$0tux>pN`v#~LAIpSWH!%(t$J!A zsHX}7sHO3i-whf&cJPG;*p{&14isKx4e{7Nci|FdaCu`7~w4wyyVt2x2P=fF;C zUC-sj9%RtQ1#HN<6zoQ=`%Z3igXgD^Dh_}@6-@0iTSCx8eG6fNG@|-p&rqZh zVn3>=s}Q!l@F19}y%@H31%r8qaRo6`t5Y14o1WsMw+OL_S;U=z-!<@j8ak`Dco3l2#MftGyk@|~sG+=* zM-+5GT!KgA1Qny1K7I&GJ@$C?W>NMds2)Z=q>Hv*h%`&BH~XMLQVaiq(~?@{gZ?MO zaIW-KR0IA7?h|@L!7nuP-55dHi$I(2b=^3Y8W%Cds>6G;0Vhf7agg$o=rUlFR&X4B zZ8o)z8aTw%*)&eX2IF#fGX9S{DFkD^xcklP1Ueat8EWdp{ZOceyU)o!S+PllCfP4y-xZRa#5P{`*NNUobeim9;g@FT}se-jwHLz4Mm|xZ^ zV~F&efjH4=DS|3G80}{}sqMSC_l{Qc1n4b9qZsifo>;68BrDx+#fkbXil_88ES0)G zY{MLt5*OOA#EsBu!+QX)bHv2csdm@pxy`4LrQb{unP<`UK!)>J;Nk4*^SEzVnN98V z&g`vDd|&<#aAIb7WRVk->9OR*XtR>jktkMN#$9?r6iO#q;x$Pzb2hE`!3A?HQ7jKG zoA`fj_EjvFF=CU?Crd2bDGp!9blvzf`%LU}ka*aQ{(iDuoWn=--Nx%0p1UTc=MRr- zq}oOOT^wwr2HwLx@#-a?=Td?Lazm?TH8$r*Dx$bi%}rK3fJ^WzV73lNa62tueh6t|E$d7yA0)~ z7R&+M1AZa7@9fk(O)-ntrzn3%$l{n^qImodisll<>ds6CSsaQ-D+z9;Mt=|7V^611 Q)KXt<8 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 0b15329..6a3f21d 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -336,7 +336,7 @@ top_statement_list: namespace_name: T_STRING { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.NameNamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -354,8 +354,8 @@ namespace_name: Value: $3.Value, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, part) $$ = $1 } @@ -365,28 +365,28 @@ name: namespace_name { $$ = &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -433,9 +433,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -446,9 +446,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracketTkn: $3, Stmts: $4, @@ -491,8 +491,8 @@ top_statement: $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), UseTkn: $1, - UseDeclarations: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -502,8 +502,8 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, Type: $2, - UseDeclarations: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -512,8 +512,8 @@ top_statement: $$ = &ast.StmtConstList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ConstTkn: $1, - Consts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Consts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -542,41 +542,41 @@ group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { if $5 != nil { - $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + $4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5) } $$ = &ast.StmtGroupUse{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6), Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $4.(*ParserSeparatedList).Items, + SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { if $6 != nil { - $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + $5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6) } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -586,41 +586,41 @@ mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { if $5 != nil { - $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + $4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5) } $$ = &ast.StmtGroupUse{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6), Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $4.(*ParserSeparatedList).Items, + SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { if $6 != nil { - $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + $5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6) } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -640,14 +640,14 @@ possible_comma: inline_use_declarations: inline_use_declarations ',' inline_use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | inline_use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -656,14 +656,14 @@ inline_use_declarations: unprefixed_use_declarations: unprefixed_use_declarations ',' unprefixed_use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | unprefixed_use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -672,14 +672,14 @@ unprefixed_use_declarations: use_declarations: use_declarations ',' use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -704,22 +704,22 @@ unprefixed_use_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -749,14 +749,14 @@ use_declaration: const_list: const_list ',' const_decl { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | const_decl { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -857,14 +857,14 @@ statement: { $9.(*ast.StmtFor).ForTkn = $1 $9.(*ast.StmtFor).OpenParenthesisTkn = $2 - $9.(*ast.StmtFor).Init = $3.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Init = $3.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).InitSemiColonTkn = $4 - $9.(*ast.StmtFor).Cond = $5.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Cond = $5.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CondSemiColonTkn = $6 - $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Loop = $7.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 $9.(*ast.StmtFor).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) @@ -1004,8 +1004,8 @@ statement: { $5.(*ast.StmtDeclare).DeclareTkn = $1 $5.(*ast.StmtDeclare).OpenParenthesisTkn = $2 - $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items - $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $5.(*ast.StmtDeclare).Consts = $3.(*ParserSeparatedList).Items + $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 $5.(*ast.StmtDeclare).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) @@ -1166,11 +1166,11 @@ function_declaration_statement: Value: $3.Value, }, OpenParenthesisTkn: $5, - Params: $6.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $6.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $6.(*ParserSeparatedList).Items, + SeparatorTkns: $6.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $7, - ColonTkn: $8.(*ast.ReturnType).ColonTkn, - ReturnType: $8.(*ast.ReturnType).Type, + ColonTkn: $8.(*ReturnType).ColonTkn, + ReturnType: $8.(*ReturnType).Type, OpenCurlyBracketTkn: $9, Stmts: $10, CloseCurlyBracketTkn: $11, @@ -1357,10 +1357,10 @@ interface_extends_list: | T_EXTENDS name_list { $$ = &ast.StmtInterface{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ExtendsTkn: $1, - Extends: $2.(*ast.ParserSeparatedList).Items, - ExtendsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Extends: $2.(*ParserSeparatedList).Items, + ExtendsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1373,10 +1373,10 @@ implements_list: | T_IMPLEMENTS name_list { $$ = &ast.StmtClass{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ImplementsTkn: $1, - Implements: $2.(*ast.ParserSeparatedList).Items, - ImplementsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Implements: $2.(*ParserSeparatedList).Items, + ImplementsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1400,8 +1400,8 @@ foreach_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -1410,8 +1410,8 @@ foreach_variable: $$ = &ast.ExprList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -1707,21 +1707,21 @@ parameter_list: } | /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } ; non_empty_parameter_list: parameter { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | non_empty_parameter_list ',' parameter { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -1836,11 +1836,11 @@ type: return_type: /* empty */ { - $$ = &ast.ReturnType{} + $$ = &ReturnType{} } | ':' type_expr { - $$ = &ast.ReturnType{ + $$ = &ReturnType{ ColonTkn: $1, Type: $2, } @@ -1850,7 +1850,7 @@ return_type: argument_list: '(' ')' { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, @@ -1858,7 +1858,7 @@ argument_list: } | '(' non_empty_argument_list possible_comma ')' { - argumentList := $2.(*ast.ArgumentList) + argumentList := $2.(*ArgumentList) argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4) argumentList.OpenParenthesisTkn = $1 if $3 != nil { @@ -1873,14 +1873,14 @@ argument_list: non_empty_argument_list: argument { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Arguments: []ast.Vertex{$1}, } } | non_empty_argument_list ',' argument { - $1.(*ast.ArgumentList).SeparatorTkns = append($1.(*ast.ArgumentList).SeparatorTkns, $2) - $1.(*ast.ArgumentList).Arguments = append($1.(*ast.ArgumentList).Arguments, $3) + $1.(*ArgumentList).SeparatorTkns = append($1.(*ArgumentList).SeparatorTkns, $2) + $1.(*ArgumentList).Arguments = append($1.(*ArgumentList).Arguments, $3) $$ = $1 } @@ -1995,8 +1995,8 @@ class_statement: Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $4), Modifiers: $1, Type: $2, - Properties: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Properties: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -2006,8 +2006,8 @@ class_statement: Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $4), Modifiers: $1, ConstTkn: $2, - Consts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Consts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -2016,12 +2016,12 @@ class_statement: traitUse := &ast.StmtTraitUse{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, - Traits: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Traits: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } switch n := $3.(type) { - case *ast.TraitAdaptationList : + case *TraitAdaptationList : traitUse.OpenCurlyBracketTkn = n.OpenCurlyBracketTkn traitUse.Adaptations = n.Adaptations traitUse.CloseCurlyBracketTkn = n.CloseCurlyBracketTkn @@ -2049,11 +2049,11 @@ class_statement: Value: $4.Value, }, OpenParenthesisTkn: $6, - Params: $7.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $7.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $7.(*ParserSeparatedList).Items, + SeparatorTkns: $7.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $8, - ColonTkn: $9.(*ast.ReturnType).ColonTkn, - ReturnType: $9.(*ast.ReturnType).Type, + ColonTkn: $9.(*ReturnType).ColonTkn, + ReturnType: $9.(*ReturnType).Type, Stmt: $10, } } @@ -2062,14 +2062,14 @@ class_statement: name_list: name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | name_list ',' name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -2085,7 +2085,7 @@ trait_adaptations: } | '{' '}' { - $$ = &ast.TraitAdaptationList{ + $$ = &TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenCurlyBracketTkn: $1, CloseCurlyBracketTkn: $2, @@ -2093,7 +2093,7 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.TraitAdaptationList{ + $$ = &TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, Adaptations: $2, @@ -2132,13 +2132,13 @@ trait_precedence: absolute_trait_method_reference T_INSTEADOF name_list { $$ = &ast.StmtTraitUsePrecedence{ - Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ParserSeparatedList).Items), + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, InsteadofTkn: $2, - Insteadof: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Insteadof: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -2148,9 +2148,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Alias: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), @@ -2163,9 +2163,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Alias: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), @@ -2178,9 +2178,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ @@ -2194,9 +2194,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, } @@ -2206,7 +2206,7 @@ trait_alias: trait_method_reference: identifier { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2224,7 +2224,7 @@ trait_method_reference: absolute_trait_method_reference: name T_PAAMAYIM_NEKUDOTAYIM identifier { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, @@ -2349,14 +2349,14 @@ member_modifier: property_list: property_list ',' property { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | property { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2399,14 +2399,14 @@ property: class_const_list: class_const_list ',' class_const_decl { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | class_const_decl { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2470,7 +2470,7 @@ echo_expr: for_exprs: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_for_exprs { @@ -2481,14 +2481,14 @@ for_exprs: non_empty_for_exprs: non_empty_for_exprs ',' expr { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2500,10 +2500,10 @@ anonymous_class: class := &ast.StmtClass{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, OpenCurlyBracketTkn: $6, Stmts: $7, CloseCurlyBracketTkn: $8, @@ -2532,10 +2532,10 @@ new_expr: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, - OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ast.ArgumentList).Arguments, - SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ArgumentList).Arguments, + SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } } else { $$ = &ast.ExprNew{ @@ -2564,8 +2564,8 @@ expr_without_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, EqualTkn: $5, @@ -2579,8 +2579,8 @@ expr_without_variable: Var: &ast.ExprList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, }, EqualTkn: $4, @@ -3248,11 +3248,11 @@ inline_function: closure.FunctionTkn = $1 closure.AmpersandTkn = $2 closure.OpenParenthesisTkn = $4 - closure.Params = $5.(*ast.ParserSeparatedList).Items - closure.SeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + closure.Params = $5.(*ParserSeparatedList).Items + closure.SeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns closure.CloseParenthesisTkn = $6 - closure.ColonTkn = $8.(*ast.ReturnType).ColonTkn - closure.ReturnType = $8.(*ast.ReturnType).Type + closure.ColonTkn = $8.(*ReturnType).ColonTkn + closure.ReturnType = $8.(*ReturnType).Type closure.OpenCurlyBracketTkn = $9 closure.Stmts = $10 closure.CloseCurlyBracketTkn = $11 @@ -3266,11 +3266,11 @@ inline_function: FnTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, - Params: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $4.(*ParserSeparatedList).Items, + SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $5, - ColonTkn: $6.(*ast.ReturnType).ColonTkn, - ReturnType: $6.(*ast.ReturnType).Type, + ColonTkn: $6.(*ReturnType).ColonTkn, + ReturnType: $6.(*ReturnType).Type, DoubleArrowTkn: $8, Expr: $9, } @@ -3302,8 +3302,8 @@ lexical_vars: $$ = &ast.ExprClosure{ UseTkn: $1, UseOpenParenthesisTkn: $2, - Use: $3.(*ast.ParserSeparatedList).Items, - UseSeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Use: $3.(*ParserSeparatedList).Items, + UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, UseCloseParenthesisTkn: $4, } } @@ -3312,14 +3312,14 @@ lexical_vars: lexical_var_list: lexical_var_list ',' lexical_var { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | lexical_var { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -3363,10 +3363,10 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list @@ -3376,13 +3376,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3397,13 +3397,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3416,10 +3416,10 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } ; @@ -3490,7 +3490,7 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = &ast.ArgumentList{} + $$ = &ArgumentList{} } | argument_list { @@ -3505,8 +3505,8 @@ dereferencable_scalar: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -3515,8 +3515,8 @@ dereferencable_scalar: $$ = &ast.ExprArray{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -3809,13 +3809,13 @@ callable_variable: Var: $1, ObjectOperatorTkn: $2, Method: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { methodCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn methodCall.Method = brackets.Child methodCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3847,7 +3847,7 @@ variable: Property: $3, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn propertyFetch.Property = brackets.Child propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3944,7 +3944,7 @@ new_variable: Property: $3, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn propertyFetch.Property = brackets.Child propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3983,7 +3983,7 @@ member_name: } | '{' expr '}' { - $$ = &ast.ParserBrackets{ + $$ = &ParserBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, @@ -4007,7 +4007,7 @@ property_name: } | '{' expr '}' { - $$ = &ast.ParserBrackets{ + $$ = &ParserBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, @@ -4023,7 +4023,7 @@ property_name: array_pair_list: non_empty_array_pair_list { - pairList := $1.(*ast.ParserSeparatedList) + pairList := $1.(*ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { @@ -4048,14 +4048,14 @@ possible_array_pair: non_empty_array_pair_list: non_empty_array_pair_list ',' possible_array_pair { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | possible_array_pair { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -4114,8 +4114,8 @@ array_pair: Position: yylex.(*Parser).builder.NewTokensPosition($3, $6), ListTkn: $3, OpenBracketTkn: $4, - Items: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $6, }, } @@ -4128,8 +4128,8 @@ array_pair: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, } @@ -4334,15 +4334,15 @@ internal_functions_in_yacc: T_ISSET '(' isset_variables possible_comma ')' { if $4 != nil { - $3.(*ast.ParserSeparatedList).SeparatorTkns = append($3.(*ast.ParserSeparatedList).SeparatorTkns, $4) + $3.(*ParserSeparatedList).SeparatorTkns = append($3.(*ParserSeparatedList).SeparatorTkns, $4) } $$ = &ast.ExprIsset{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), IssetTkn: $1, OpenParenthesisTkn: $2, - Vars: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Vars: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $5, } } @@ -4403,14 +4403,14 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | isset_variables ',' isset_variable { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 043c404..40e1093 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -2644,97 +2644,3 @@ func (n *NameNamePart) Accept(v Visitor) { func (n *NameNamePart) GetPosition() *position.Position { return n.Position } - -// TODO: move to private section - -type ParserBrackets struct { - Position *position.Position - OpenBracketTkn *token.Token - Child Vertex - CloseBracketTkn *token.Token -} - -func (n *ParserBrackets) Accept(v Visitor) { - // do nothing -} - -func (n *ParserBrackets) GetPosition() *position.Position { - return n.Position -} - -type ParserSeparatedList struct { - Position *position.Position - Items []Vertex - SeparatorTkns []*token.Token -} - -func (n *ParserSeparatedList) Accept(v Visitor) { - // do nothing -} - -func (n *ParserSeparatedList) GetPosition() *position.Position { - return n.Position -} - -// TraitAdaptationList node -type TraitAdaptationList struct { - Position *position.Position - OpenCurlyBracketTkn *token.Token - Adaptations []Vertex - CloseCurlyBracketTkn *token.Token -} - -func (n *TraitAdaptationList) Accept(v Visitor) { - // do nothing -} - -func (n *TraitAdaptationList) GetPosition() *position.Position { - return n.Position -} - -// ArgumentList node -type ArgumentList struct { - Position *position.Position - OpenParenthesisTkn *token.Token - Arguments []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token -} - -func (n *ArgumentList) Accept(v Visitor) { - // do nothing -} - -func (n *ArgumentList) GetPosition() *position.Position { - return n.Position -} - -type ReturnType struct { - Position *position.Position - ColonTkn *token.Token - Type Vertex -} - -func (n *ReturnType) Accept(v Visitor) { - // do nothing -} - -func (n *ReturnType) GetPosition() *position.Position { - return n.Position -} - -// TraitMethodRef node -type TraitMethodRef struct { - Position *position.Position - Trait Vertex - DoubleColonTkn *token.Token - Method Vertex -} - -func (n *TraitMethodRef) Accept(v Visitor) { - // do nothing -} - -func (n *TraitMethodRef) GetPosition() *position.Position { - return n.Position -}