You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
759 B
18 lines
759 B
<?php
|
|
/** @license MIT
|
|
* Copyright 2021 Dustin Wilson et al.
|
|
* See LICENSE file for details */
|
|
|
|
declare(strict_types=1);
|
|
namespace dW\Lit\Grammar;
|
|
|
|
abstract class NamedPatternListList extends ImmutableList {
|
|
public function __construct(array $array) {
|
|
foreach ($array as $k => $v) {
|
|
assert(is_string($k), new \Exception('String index expected for supplied array, found ' . gettype($k) . "\n"));
|
|
assert($v instanceof GrammarInclude || $v instanceof Pattern || $v instanceof PatternList, new \Exception(__NAMESPACE__ . '\GrammarInclude, ' . __NAMESPACE__ . '\Pattern, or ' . __NAMESPACE__ . '\PatternList value expected for supplied array, found ' . gettype($v) . "\n"));
|
|
}
|
|
|
|
$this->storage = $array;
|
|
}
|
|
}
|