Returns the minimum error cost that kind must incur when tok
is the current token. 0 means the token is reachable (or the rule
is nullable); positive means the rule cannot make progress without
at least that much error cost.
Precomputed dist(q, a): minimum insertion cost to reach a point
where terminal terminal can be matched, starting from parser
state (kind, state). Returns 0 as the conservative default
(admissible — parent context might accept the terminal after a pop).