chiark / gitweb /
lowering: Get state transition right for non-heavy targets
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Jul 2021 02:05:59 +0000 (03:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Jul 2021 23:29:54 +0000 (00:29 +0100)
commit5e307b210dc13e352ba846b794d8880a404a4314
treee92efe66740a44c76f6f3c5611f07dd30380d234
parent2a70bd905903883df14291ce7e117a22777c182f
lowering: Get state transition right for non-heavy targets

We would go into state B if we found any target.  But that's not
right: the chart says to disregard heavy targets, and indeed we don't
want to stack other things below them.

This can lead q_z_top legitimately being null on exit from the walk
loop, if there are no pieces in B or Z.  We still need a q_z_top: we
can't leave it open, because we want to make sure we only lower
pieces, not raise them.  So we choose the lowest piece in Q, or,
failing that, P.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts