Skip to content

Commit ccf9951

Browse files
committed
Implementation of simple-selectors() function #310
1 parent e84f40f commit ccf9951

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/Compiler.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6308,4 +6308,23 @@ protected function libSelectorParse($args)
63086308

63096309
return $this->formatOutputSelector($selectors);
63106310
}
6311+
6312+
protected static $libSimpleSelectors = ['selector'];
6313+
protected function libSimpleSelectors($args)
6314+
{
6315+
$selector = reset($args);
6316+
$selector = $this->getSelectorArg($selector);
6317+
6318+
// remove selectors list layer, keeping the first one
6319+
$selector = reset($selector);
6320+
// remove parts list layer, keeping the first part
6321+
$part = reset($selector);
6322+
6323+
$listParts = [];
6324+
foreach ($part as $p) {
6325+
$listParts[] = [Type::T_STRING, '', [$p]];
6326+
}
6327+
6328+
return [Type::T_LIST, ',', $listParts];
6329+
}
63116330
}

0 commit comments

Comments
 (0)