@@ -138,9 +138,12 @@ module.exports = {
138138 what . loc . start = what . value [ 0 ] . loc . start ;
139139 }
140140 } else if ( this . token === "{" ) {
141+
142+ // EncapsedPart
143+ const part = this . node ( 'encapsedpart' ) ;
141144 const expr = this . next ( ) . read_expr ( ) ;
142145 this . expect ( "}" ) && this . next ( ) ;
143- what = this . node ( "encapsed" ) ( [ what , expr ] , null , "offset" ) ;
146+ what = this . node ( "encapsed" ) ( [ what , part ( expr , true ) ] , null , "offset" ) ;
144147 if ( what . loc && what . value [ 0 ] . loc ) {
145148 what . loc . start = what . value [ 0 ] . loc . start ;
146149 }
@@ -159,18 +162,18 @@ module.exports = {
159162 // $obj->${$varname}
160163 name = this . next ( ) . read_expr ( ) ;
161164 this . expect ( "}" ) && this . next ( ) ;
162- what = what ( "literal " , "literal" , name , null ) ;
165+ what = what ( "variable " , name , true ) ;
163166 } else {
164167 // $obj->$$varname
165168 name = this . read_expr ( ) ;
166169 what = what ( "variable" , name , false ) ;
167170 }
168171 break ;
169172 case "{" :
170- what = this . node ( "literal " ) ;
173+ what = this . node ( "encapsedpart " ) ;
171174 name = this . next ( ) . read_expr ( ) ;
172175 this . expect ( "}" ) && this . next ( ) ;
173- what = what ( "literal" , name , null ) ;
176+ what = what ( name , true ) ;
174177 break ;
175178 default :
176179 this . error ( [ this . tok . T_STRING , this . tok . T_VARIABLE , "$" , "{" ] ) ;
0 commit comments