docs: def pformat_exc(self, exc):
          """ Format an exception message for the last query's parse error """
          lines = []
          try:
              pre_nl = self.last_query.rindex("\n", 0, exc.loc) + 1
          except ValueError:
              pre_nl = 0
          try:
              post_nl = self.last_query.index("\n", exc.loc)
          except ValueError:
              post_nl = len(self.last_query)
          lines.append(self.last_query[:post_nl])
          lines.append(" " * (exc.loc - pre_nl) + "^")
          lines.append(str(exc))
          return "\n".join(lines)