Skip to content

Commit 3e1132d

Browse files
committed
Accumulate traversal pairs
1 parent 2348ca9 commit 3e1132d

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

tools/FileRefExtractor/FileRefGenerator.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,17 +559,22 @@ public static function generate(int|string $layer, string $inputSchema, string $
559559
static function (array $stack) use ($locations, $TL, $tmp, &$traversalPairs, &$validated, $storyMethods, $starMethods, $stickerMethods): void {
560560
$slice = [];
561561
$hadAny = false;
562+
$hadAnyNotNoop = false;
563+
$tmpPairs = [];
562564
$hadAnyWithNoFlags = false;
563565
$skippedDueToFlags = [];
564566
$top = end($stack)[0];
565567
for ($x = \count($stack)-1; $x >= 0; $x--) {
566568
$pair = $stack[$x];
567-
//$traversalPairs[json_encode($pair)] = $pair;
568569
foreach ($locations[$pair[0]] ?? [] as $op) {
569570
$normalized = $op->normalize($slice, $pair[0], false);
570571
if ($normalized === null) {
571572
continue;
572573
}
574+
if (!$normalized instanceof Noop) {
575+
$hadAnyNotNoop = true;
576+
}
577+
$tmpPairs[json_encode($pair)] = $pair;
573578
$hadAny = true;
574579
$normalized->build(new TLContext($TL, $tmp, $top, $TL->isConstructor($top)));
575580
$validated[$pair[0]][spl_object_id($op)] = $op;
@@ -583,6 +588,9 @@ static function (array $stack) use ($locations, $TL, $tmp, &$traversalPairs, &$v
583588
}
584589
$slice[] = $pair;
585590
}
591+
if ($hadAnyNotNoop) {
592+
$traversalPairs += $tmpPairs;
593+
}
586594
if (!$hadAny) {
587595
throw new AssertionError("Uncovered path: " . json_encode($stack));
588596
}

0 commit comments

Comments
 (0)