@@ -1402,6 +1402,11 @@ protected function value(&$out)
14021402 }
14031403 }
14041404
1405+ if ($ this ->matchChar ('& ' , true )) {
1406+ $ out = [Type::T_SELF ];
1407+ return true ;
1408+ }
1409+
14051410 if ($ char === '$ ' && $ this ->variable ($ out )) {
14061411 return true ;
14071412 }
@@ -1991,28 +1996,18 @@ protected function interpolation(&$out, $lookWhite = true)
19911996 $ s = $ this ->count ;
19921997
19931998 if ($ this ->literal ('#{ ' , 2 ) && $ this ->valueList ($ value ) && $ this ->matchChar ('} ' , false )) {
1994- if ($ lookWhite ) {
1995- $ left = preg_match ('/\s/ ' , $ this ->buffer [$ s - 1 ]) ? ' ' : '' ;
1996- $ right = preg_match ('/\s/ ' , $ this ->buffer [$ this ->count ]) ? ' ' : '' ;
1999+ if ($ value === [Type::T_SELF ]) {
2000+ $ out = $ value ;
19972001 } else {
1998- $ left = $ right = false ;
1999- }
2000-
2001- $ out = [Type::T_INTERPOLATE , $ value , $ left , $ right ];
2002- $ this ->eatWhiteDefault = $ oldWhite ;
2002+ if ($ lookWhite ) {
2003+ $ left = preg_match ('/\s/ ' , $ this ->buffer [$ s - 1 ]) ? ' ' : '' ;
2004+ $ right = preg_match ('/\s/ ' , $ this ->buffer [$ this ->count ]) ? ' ' : '' ;
2005+ } else {
2006+ $ left = $ right = false ;
2007+ }
20032008
2004- if ($ this ->eatWhiteDefault ) {
2005- $ this ->whitespace ();
2009+ $ out = [Type::T_INTERPOLATE , $ value , $ left , $ right ];
20062010 }
2007-
2008- return true ;
2009- }
2010-
2011- $ this ->seek ($ s );
2012-
2013- if ($ this ->literal ('#{ ' , 2 ) && $ this ->selectorSingle ($ sel ) && $ this ->matchChar ('} ' , false )) {
2014- $ out = $ sel [0 ];
2015-
20162011 $ this ->eatWhiteDefault = $ oldWhite ;
20172012
20182013 if ($ this ->eatWhiteDefault ) {
@@ -2023,6 +2018,7 @@ protected function interpolation(&$out, $lookWhite = true)
20232018 }
20242019
20252020 $ this ->seek ($ s );
2021+
20262022 $ this ->eatWhiteDefault = $ oldWhite ;
20272023
20282024 return false ;
0 commit comments