static replacer(k, v) {
    if (v instanceof ParseTree || v instanceof Token) {
      let rv = {type: v.type};
      Object.keys(v).forEach(function(name) {
        // assigns 'type' again for Token, but no big deal.
        if (name !== 'location')
          rv[name] = v[name];
      });
      return rv;
    }
    return v;
  }
Like stripLocation, but also adds 'type' properties to the output.
@param {string} key
@param {*} value
@return {*}