class CmakeOutputParser implements BuildOutputParser {

  @VisibleForTesting
  static ErrorFields matchFileAndLineNumberErrorParts(
    @NonNull Matcher matcher, @NonNull String line) {
    ErrorFields fields = new ErrorFields();
    fields.lineNumber = -1;
    if (matcher.group(3) != null) {
      fields.lineNumber = Integer.valueOf(matcher.group(3));
    }

    fields.columnNumber = -1;
    if (matcher.group(4) != null) {
      fields.columnNumber = Integer.valueOf(matcher.group(4));
    }

    fields.errorMessage = line;
    if (matcher.group(5) != null) {
      fields.errorMessage = matcher.group(5);
    }

    return fields;
  }

}