Skip to content

Commit

Permalink
Fix parse error effecting pseudo classes with "when" guards
Browse files Browse the repository at this point in the history
Bug: T353144
Change-Id: I6654f8b5849b015359cdfad258dcfcf3dd155534
  • Loading branch information
polishdeveloper authored and Krinkle committed Apr 19, 2024
1 parent 6034560 commit 54f213a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/Less/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2372,13 +2372,15 @@ private function parseImportant() {
}

private function parseSub() {
$this->save();
if ( $this->matchChar( '(' ) ) {
$a = $this->parseAddition();
if ( $a ) {
$this->expectChar( ')' );
return new Less_Tree_Expression( [ $a ], true ); // instead of $e->parens = true so the value is cached
if ( $a && $this->matchChar( ')' ) ) {
$this->forget();
return new Less_Tree_Expression( [ $a ], true );
}
}
$this->restore();
}

/**
Expand Down
2 changes: 0 additions & 2 deletions test/phpunit/FixturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class phpunit_FixturesTest extends phpunit_bootstrap {
// Temporary disabled
'comments2' => true, // T353132
'css' => true, // T352911 & T352866
'css-guards' => true, // T353144
'import' => true, // T353146
'import-reference' => true, // T352862
'mixin-args' => true, // T352897
Expand Down Expand Up @@ -60,7 +59,6 @@ class phpunit_FixturesTest extends phpunit_bootstrap {
'import-remote' => true,
'import' => true,
'css-escapes' => true,
'css-guards' => true,
'parse-interpolation' => true,
'selectors' => true,
'property-accessors' => true,
Expand Down

0 comments on commit 54f213a

Please sign in to comment.