Looks at the current nest as well as into its children (if necessary) to make sure the right id is returned. Otherise, ordering of tokens might not be preserved.
find_start_pos_id(pd, pos, by, direction, after)
A parse table.
The position where the new id should be inserted.
By how much the reference pos_id
should be increased / decreased
to create a new id.
Derived from after
. 1
if after = TRUE
, -1
otherwise.
Boolean indicating whether it should be inserted after or before
pos
.