     if (checkTy == .next || checkTy == .same) && contents.isEmpty {
       let type = (checkTy == .next) ? "NEXT" : "SAME"
       let loc = CheckLoc.inBuffer(buffer.baseAddress!, buf)
-      diagnose(.error, loc, "found '\(usedPrefix)-\(type)' without previous '\(usedPrefix): line")
+      diagnose(.error, at: loc, with: "found '\(usedPrefix)-\(type)' without previous '\(usedPrefix): line", options: options)
       return []
     }
 

          // emitting a backreference.
          if let varParenNum = self.variableDefs[name] {
            if varParenNum < 1 || varParenNum > 9 {
              diagnose(.error, diagLoc, "Can't back-reference more than 9 variables")
              return nil
            }
            self.addBackrefToRegEx(varParenNum)

    }

    // Okay, add the string we captured to the output vector and move on.
    let cs = CheckString(
      pattern: pat,
      prefix: usedPrefix,
      loc: .string(patternLoc.message),
      dagNotStrings: dagNotMatches
    )
    contents.append(cs)
    dagNotMatches = implicitNegativeChecks
  }

  // Add an EOF pattern for any trailing CHECK-DAG/-NOTs, and use the first
  // prefix as a filler for the error message.
	if !dagNotMatches.isEmpty {
    let cs = CheckString(
      pattern: Pattern(withType: .EOF),
      prefix: prefixes.first!,
      loc: dagNotMatches.last!.patternLoc,
      dagNotStrings: dagNotMatches
    )
    contents.append(cs)
	}

  if contents.isEmpty {
    print("error: no check strings found with prefix\(contents.count == 1 ? " " : "es ")")
