Skip to content

Commit a5a1f1a

Browse files
authored
[BUGFIX] Revert broken support for multiple comments (#740)
This reverts e4c66f6 (#672), which broke comment parsing in strict mode. We'll need to re-implement support for multiple comments later in a way that does not break the existing comment parsing.
1 parent e2bb6b7 commit a5a1f1a

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ Please also have a look at our
4343
### Fixed
4444

4545
- Fix type errors in PHP strict mode (#664)
46-
- Fix comment parsing to support multiple comments (#672)
4746
- Fix undefined local variable in `CalcFunction::parse()` (#593)
4847
- Fix PHP notice caused by parsing invalid color values having less than 6
4948
characters (#485)

src/Rule/Rule.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ public static function parse(ParserState $oParserState): Rule
108108
$oParserState->consume(';');
109109
}
110110

111-
while (\preg_match('/\\s/isSu', $oParserState->peek()) === 1) {
112-
$oParserState->consume(1);
113-
}
111+
$oParserState->consumeWhiteSpace();
114112

115113
return $oRule;
116114
}

tests/ParserTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,11 +1171,14 @@ public function flatCommentExtractingOneComment(): void
11711171
self::assertCount(1, $comments);
11721172
self::assertSame('Find Me!', $comments[0]->getComment());
11731173
}
1174+
11741175
/**
11751176
* @test
11761177
*/
11771178
public function flatCommentExtractingTwoComments(): void
11781179
{
1180+
self::markTestSkipped('This is currently broken.');
1181+
11791182
$parser = new Parser('div {/*Find Me!*/left:10px; /*Find Me Too!*/text-align:left;}');
11801183
$document = $parser->parse();
11811184
$contents = $document->getContents();

tests/RuleSet/DeclarationBlockTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@ public function canRemoveCommentsFromRulesUsingStrictParsing(
467467
string $cssWithComments,
468468
string $cssWithoutComments
469469
): void {
470-
self::markTestSkipped('This currently crashes, and we need to fix it.');
471-
472470
$parserSettings = ParserSettings::create()->withLenientParsing(false);
473471
$document = (new Parser($cssWithComments, $parserSettings))->parse();
474472

0 commit comments

Comments
 (0)