@@ -209,7 +209,7 @@ protected function lexBlock(): void
209209 protected function lexExpression (): void
210210 {
211211 if (preg_match ('/\G\s+/A ' , $ this ->source , $ matches , offset: $ this ->cursor ) === 1 ) {
212- $ this ->moveCursor ($ matches [0 ] ?? '' );
212+ $ this ->moveCursor ($ matches [0 ]);
213213 }
214214
215215 $ this ->ensureStreamNotEnded ();
@@ -221,10 +221,10 @@ protected function lexExpression(): void
221221 }
222222
223223 $ token = match (true ) {
224- preg_match (LexerOptions::comparisonOperatorRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::Comparison, $ matches [0 ]],
225- preg_match (LexerOptions::identifierRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::Identifier, $ matches [0 ]],
226- preg_match (LexerOptions::stringLiteralRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::String, $ matches [0 ]],
227- preg_match (LexerOptions::numberLiteralRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::Number, $ matches [0 ]],
224+ preg_match (LexerOptions::comparisonOperatorRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::Comparison, $ matches [0 ] ?? '' ],
225+ preg_match (LexerOptions::identifierRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::Identifier, $ matches [0 ] ?? '' ],
226+ preg_match (LexerOptions::stringLiteralRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::String, $ matches [0 ] ?? '' ],
227+ preg_match (LexerOptions::numberLiteralRegex (), $ this ->source , $ matches , offset: $ this ->cursor ) === 1 => [TokenType::Number, $ matches [0 ] ?? '' ],
228228 $ this ->cursor + 1 < $ this ->end && $ this ->source [$ this ->cursor ] === '. ' && $ this ->source [$ this ->cursor + 1 ] === '. ' => [TokenType::DotDot, '.. ' ],
229229 array_key_exists ($ this ->source [$ this ->cursor ], LexerOptions::specialCharacters ()) => [LexerOptions::specialCharacters ()[$ this ->source [$ this ->cursor ]], $ this ->source [$ this ->cursor ]],
230230 default => throw SyntaxException::unexpectedCharacter ($ this ->source [$ this ->cursor ]),
0 commit comments