chromium/components/autofill/core/browser/form_parsing/regex_patterns.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/core/browser/form_parsing/regex_patterns.h"

#include "base/check.h"
#include "base/notreached.h"
#include "components/autofill/core/browser/form_parsing/regex_patterns_inl.h"
#include "components/autofill/core/browser/heuristic_source.h"
#include "components/autofill/core/common/autofill_features.h"

namespace autofill {

namespace {

// Returns the span of MatchPatternRefs for the given pattern name, language
// code, and pattern source.
//
// Hits a CHECK if the given pattern source contains no patterns for the given
// name.
//
// Falls back to the union of all patterns of a the given name in the given
// pattern source if there are no patterns for the given language.
base::span<const MatchPatternRef> GetMatchPatterns(
    std::string_view name,
    std::string_view language_code,
    PatternSource pattern_source) {}

}  // namespace

std::optional<PatternSource> GetActivePatternSource() {}

base::span<const MatchPatternRef> GetMatchPatterns(
    std::string_view name,
    std::optional<LanguageCode> language_code,
    PatternSource pattern_source) {}

base::span<const MatchPatternRef> GetMatchPatterns(
    FieldType type,
    std::optional<LanguageCode> language_code,
    PatternSource pattern_source) {}

bool IsSupportedLanguageCode(LanguageCode language_code) {}

// The dereferencing operator implements the distinction between ordinary and
// supplementary patterns (see the header). This is why it must return a copy,
// rather than a const reference.
MatchingPattern MatchPatternRef::operator*() const {}

bool AreMatchingPatternsEqual(PatternSource a,
                              PatternSource b,
                              LanguageCode language_code) {}

}  // namespace autofill