Browse Source

Cleaning up

main
Dustin Wilson 3 years ago
parent
commit
a073df1c5d
  1. 16
      lib/Scope/Parser.php

16
lib/Scope/Parser.php

@ -15,16 +15,17 @@ class Parser {
protected static Parser $instance;
protected function __construct(string $selector) {
$this->data = new Data($selector);
}
public static function parse(string $selector): Matcher|false {
self::$instance = new self($selector);
return self::parseSelector();
}
protected function __construct(string $selector) {
$this->data = new Data($selector);
}
protected static function parseComposite(): Matcher {
if (self::$debug) {
self::debug();
@ -175,12 +176,7 @@ class Parser {
self::throw('valid scope syntax', $token);
}
$segments = explode('.', $token);
/*foreach ($segments as $index => $segment) {
$segments[$index] = ($segment !== '*') ? new SegmentMatcher($segment) : new TrueMatcher();
}*/
$result = new ScopeMatcher(...$segments);
$result = new ScopeMatcher(...explode('.', $token));
if (self::$debug) {
self::debugResult($result);

Loading…
Cancel
Save