substSlice

Enabled: @param args Each arg[i] is of a type matched to the corresponding
dollar-hole. For example, if dollar-hole 3 (ie "${3}")
has rank "?*+", then args[3] must be a list of lists of
lists of terms, for which the outer list may only be zero
or one long, the middle lists may be any length, and the
inner lists must all have at least one element.

Parameters:

index - Further indexes after a hole's hole-num. For example,
If a dollar-hole's hole-num is 3 and index is [4,5], then
the dollar-hole would evaluate to args[3][4][5].

index - Further indexes after a hole's hole-num. For example,
If a dollar-hole's hole-num is 3 and index is [4,5], then
the dollar-hole would access args[3][4][5]. Similarly,
an at-hole with hole-num 3 would store into
bindings[3][4][5].

Returns:

How many elements of specimen are matched? Zero indicates a
successful match of no elements, so -1 is used to instead
indicate a failed match.

startShape

For this substree and this index-prefix, what's the most number of
index elements that should be enumerated?

If this subtree has no dollar-holes, it should just return shapeSoFar.
The initial shapeSoFar is -1 (meaning "indeterminate"), so a tree with
no dollar-holes will just return -1. An non-ranking inner node (eg, a
QTerm) just asks all its children, passing to each the shapeSoFar from
the previous.

All the rest of the semantics is specific to dollar-hole, at-hole, or
to raking nodes, so see the documentation there.