function siblings($types, $offset)
{
$level = $this->levels[$offset];
$begin = Utils\lastNotGreaterThan(Utils\access($this->levelBeginnings, $level, []), $offset);
$end = Utils\firstGreaterThan(Utils\access($this->levelEndings, $level, []), $offset);
if ($types === self::ANY) {
return Utils\allWithinRange($this->tokensByLevel[$level], $begin, $end);
} else {
$result = [];
foreach ((array) $types as $type) {
$candidates = Utils\access($this->tokensByLevelAndType, [$level, $type], []);
$result = array_merge(Utils\allWithinRange($candidates, $begin, $end), $result);
}
return $result;
}
}