@@ -93,15 +93,15 @@ protected function parseParentheses()
9393
9494 continue ;
9595 }
96- $ this ->unexpected ($ token );
96+ throw $ this ->unexpected ($ token );
9797 }
9898 if ($ value = $ this ->getValueFromToken ($ token )) {
9999 $ expectComma = true ;
100100 $ parentheses ->addNode ($ value );
101101
102102 continue ;
103103 }
104- $ this ->unexpected ($ token );
104+ throw $ this ->unexpected ($ token );
105105 }
106106
107107 throw new Exception ('Missing ) to match ' . $ exceptionInfos , 5 );
@@ -122,15 +122,15 @@ protected function parseHooksArray()
122122
123123 continue ;
124124 }
125- $ this ->unexpected ($ token );
125+ throw $ this ->unexpected ($ token );
126126 }
127127 if ($ value = $ this ->getValueFromToken ($ token )) {
128128 $ expectComma = true ;
129129 $ array ->addItem ($ value );
130130
131131 continue ;
132132 }
133- $ this ->unexpected ($ token );
133+ throw $ this ->unexpected ($ token );
134134 }
135135
136136 throw new Exception ('Missing ] to match ' . $ exceptionInfos , 6 );
@@ -151,7 +151,7 @@ protected function parseBracketsArray()
151151
152152 continue ;
153153 }
154- $ this ->unexpected ($ token );
154+ throw $ this ->unexpected ($ token );
155155 }
156156 if ($ pair = $ this ->getBracketsArrayItemKeyFromToken ($ token )) {
157157 list ($ key , $ value ) = $ pair ;
@@ -160,7 +160,7 @@ protected function parseBracketsArray()
160160
161161 continue ;
162162 }
163- $ this ->unexpected ($ token );
163+ throw $ this ->unexpected ($ token );
164164 }
165165
166166 throw new Exception ('Missing } to match ' . $ exceptionInfos , 7 );
@@ -237,13 +237,13 @@ protected function parseFunction($token)
237237 $ token = $ this ->get (0 );
238238 }
239239 if (!$ token ->is ('( ' )) {
240- $ this ->unexpected ($ token );
240+ throw $ this ->unexpected ($ token );
241241 }
242242 $ this ->skip ();
243243 $ function ->setValue ($ this ->parseParentheses ());
244244 $ token = $ this ->get (0 );
245245 if (!$ token ->is ('{ ' )) {
246- $ this ->unexpected ($ token );
246+ throw $ this ->unexpected ($ token );
247247 }
248248 $ this ->skip ();
249249 $ this ->parseBlock ($ function );
@@ -291,7 +291,7 @@ protected function parseLet($token)
291291 {
292292 $ letVariable = $ this ->get (0 );
293293 if (!$ letVariable ->is ('variable ' )) {
294- $ this ->unexpected ($ letVariable , $ token );
294+ throw $ this ->unexpected ($ letVariable , $ token );
295295 }
296296
297297 return $ letVariable ->value ;
@@ -319,7 +319,7 @@ protected function parseInstructions($block)
319319 $ block ->endInstruction ();
320320 continue ;
321321 }
322- $ this ->unexpected ($ token );
322+ throw $ this ->unexpected ($ token );
323323 }
324324 }
325325
0 commit comments