diff --git a/Parser.php b/Parser.php index a3abad61..5da91dc5 100644 --- a/Parser.php +++ b/Parser.php @@ -1201,7 +1201,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag, bool $cons $value .= $this->currentLine[$cursor]; ++$cursor; - if ($consumeUntilEol && isset($this->currentLine[$cursor]) && (strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine)) { + if ($consumeUntilEol && isset($this->currentLine[$cursor]) && ($whitespaces = strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine) && '#' !== $this->currentLine[$whitespaces]) { throw new ParseException(sprintf('Unexpected token "%s".', trim(substr($this->currentLine, $cursor)))); } diff --git a/Tests/ParserTest.php b/Tests/ParserTest.php index 85341cf0..c81de6ad 100644 --- a/Tests/ParserTest.php +++ b/Tests/ParserTest.php @@ -2158,6 +2158,19 @@ public static function inlineNotationSpanningMultipleLinesProvider(): array << [ + [ + 'map' => [ + 'key' => 'value', + 'a' => 'b', + ], + 'param' => 'some', + ], + << [