Skip to content

Commit

Permalink
Remove invalid case
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 29, 2024
1 parent be455bc commit 523c04f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Token/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,6 @@ private function lexPunctuation(): void

$this->pushToken(Token::PUNCTUATION_TYPE, $currentCode, $bracket);
} elseif (':' === $currentCode) {
if ([] === $this->bracketsAndTernary) {
throw CannotTokenizeException::unexpectedCharacter($currentCode, $this->line);
}

if ($this->lastBracketMatch('[')) {
// This is a slice shortcut '[0:1]' instead
$this->lexOperator($currentCode);
Expand Down
1 change: 0 additions & 1 deletion tests/Token/Tokenizer/Fixtures/invalid7.twig

This file was deleted.

1 change: 0 additions & 1 deletion tests/Token/Tokenizer/TokenizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,5 @@ public static function tokenizeInvalidDataProvider(): iterable
yield [__DIR__.'/Fixtures/invalid4.twig', 'Unexpected character ")" at line 1.'];
yield [__DIR__.'/Fixtures/invalid5.twig', 'Unexpected character "#" at line 1.'];
yield [__DIR__.'/Fixtures/invalid6.twig', 'Unclosed comment at line 1.'];
yield [__DIR__.'/Fixtures/invalid7.twig', 'Unexpected character ":" at line 1.'];
}
}

0 comments on commit 523c04f

Please sign in to comment.