     }
 
     matchLen = fullMatch.range.length
-    return (fullMatch.range.location, matchLen)
+    return NSRange(location: fullMatch.range.location, length: matchLen)
   }
 
   /// Finds the closing sequence of a regex variable usage or definition.
   ///
-  /// \p Str has to point in the beginning of the definition (right after the
-  /// opening sequence). Returns the offset of the closing sequence within Str,
-  /// or npos if it was not found.
+  /// The given string has to start in the beginning of the definition 
+  /// (right after the opening sequence). Returns the offset of the closing 
+  /// sequence within the string, or nil if it was not found.
   private func findRegexVarEnd(_ regVar : String, brackets: (open: Character, close: Character), terminator: String) -> String.Index? {
     var string = regVar
     // Offset keeps track of the current offset within the input Str

  }
}

/// Check the input to FileCheck provided in the \p Buffer against the \p
/// CheckStrings read from the check file.
///
/// Returns false if the input fails to satisfy the checks.
private func check(input b : String, against checkStrings : [CheckString]) -> Bool {
  var buffer = b
  var failedChecks = false

  }

  /// Parses the given string into the Pattern.
  func parse(in buf : UnsafeBufferPointer<CChar>, pattern : UnsafeBufferPointer<CChar>, withPrefix prefix : String, at lineNumber : Int, options: FileCheckOptions) -> Bool {
    func mino(_ l : String.Index?, _ r : String.Index?) -> String.Index? {
      if l == nil && r == nil {
