drupflare/drangler - v0.1.0
    Preparing search index...

    Function matchingParen

    • The index of the ) that closes the ( at open, or -1.

      Written after the e2e lane converted a real Drupal dump and produced invalid SQL. The previous version took lastIndexOf(')'), which is correct until a table carries a MySQL table-level comment: router ends ) ENGINE=InnoDB COMMENT='Maps paths to various callbacks (access, page and title)', so the last ) in the statement sits inside a string literal after the column list. The body then swallowed the table options and SQLite answered no such column: "alias)`.

      Depth and quote aware for the same reason splitStatements is: a DEFAULT value or a comment can contain either character.

      Parameters

      • text: string
      • open: number

      Returns number