Skip to content

Commit

Permalink
Fix inline notation with inline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpott committed Jan 6, 2025
1 parent 9590658 commit 3b776c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/Component/Yaml/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,10 @@ private function lexInlineStructure(int &$cursor, string $closingTag, bool $cons
++$cursor;

if ($consumeUntilEol && isset($this->currentLine[$cursor]) && (strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine)) {
throw new ParseException(sprintf('Unexpected token "%s".', trim(substr($this->currentLine, $cursor))));
$remain = trim(substr($this->currentLine, $cursor));
if (!str_starts_with($remain, '#')) {
throw new ParseException(sprintf('Unexpected token "%s".', $remain));
}
}

return $value;
Expand Down

0 comments on commit 3b776c2

Please sign in to comment.