function makeArrayExtender(valueReader, thisArg) {
  return (
    /**
     * @param {Node} node Node.
     * @param {Array<*>} objectStack Object stack.
     * @this {*}
     */
    function (node, objectStack) {
      const value = valueReader.call(thisArg ?? this, node, objectStack);
      if (value !== undefined) {
        const array = /** @type {Array<*>} */ (
          objectStack[objectStack.length - 1]
        );
        extend(array, value);
      }
    }
  );
}
Make an array extender function for extending the array at the top of the
object stack.
@param {function(this: T, Node, Array<*>): (Array<*>|undefined)} valueReader Value reader.
@param {T} [thisArg] The object to use as `this` in `valueReader`.
@return {Parser} Parser.
@template T