From 71f37d08479154e53b52863d78ec880588f1d748 Mon Sep 17 00:00:00 2001 From: Paul Wankadia Date: Tue, 28 May 2024 15:42:14 +0000 Subject: [PATCH] Clean and format `#include` directives. Change-Id: Iba5a0f3a18245a22f68ba1c3d533200cc577a596 Reviewed-on: https://code-review.googlesource.com/c/re2/+/63130 Reviewed-by: Alex Chernyakhovsky Reviewed-by: Paul Wankadia --- BUILD.bazel | 7 +++++++ CMakeLists.txt | 1 + Makefile | 1 + python/_re2.cc | 10 ++++++++-- re2/bitmap256.cc | 3 +-- re2/bitmap256.h | 7 ++++--- re2/bitstate.cc | 2 ++ re2/compile.cc | 6 ++++-- re2/dfa.cc | 9 ++++++--- re2/filtered_re2.cc | 4 +++- re2/fuzzing/re2_fuzzer.cc | 2 ++ re2/mimics_pcre.cc | 1 - re2/nfa.cc | 3 ++- re2/onepass.cc | 5 +++-- re2/parse.cc | 8 ++++---- re2/prefilter.cc | 5 +++-- re2/prefilter_tree.cc | 3 +-- re2/prog.cc | 23 +++++++++++++++-------- re2/prog.h | 3 ++- re2/re2.cc | 18 +++++++++++------- re2/re2.h | 9 +++++---- re2/regexp.cc | 3 ++- re2/regexp.h | 1 + re2/set.cc | 6 +++++- re2/simplify.cc | 6 ++++-- re2/sparse_array.h | 16 +++++++++------- re2/sparse_set.h | 16 +++++++++------- re2/testing/backtrack.cc | 1 + re2/testing/charclass_test.cc | 2 +- re2/testing/compile_test.cc | 6 ++++-- re2/testing/dfa_test.cc | 7 ++++--- re2/testing/dump.cc | 2 +- re2/testing/exhaustive1_test.cc | 1 + re2/testing/exhaustive2_test.cc | 4 ++-- re2/testing/exhaustive3_test.cc | 6 +++--- re2/testing/exhaustive_test.cc | 1 - re2/testing/exhaustive_tester.cc | 10 +++++++++- re2/testing/exhaustive_tester.h | 1 + re2/testing/filtered_re2_test.cc | 8 ++++---- re2/testing/mimics_pcre_test.cc | 4 ++-- re2/testing/null_walker.cc | 2 -- re2/testing/parse_test.cc | 3 ++- re2/testing/possible_match_test.cc | 3 ++- re2/testing/random_test.cc | 2 +- re2/testing/re2_arg_test.cc | 2 +- re2/testing/re2_test.cc | 15 +++++++++------ re2/testing/regexp_benchmark.cc | 5 +++-- re2/testing/regexp_generator.cc | 7 +++++-- re2/testing/regexp_generator.h | 1 + re2/testing/regexp_test.cc | 6 +++--- re2/testing/required_prefix_test.cc | 4 ++-- re2/testing/search_test.cc | 9 ++++++--- re2/testing/set_test.cc | 9 ++++----- re2/testing/simplify_test.cc | 2 -- re2/testing/string_generator.cc | 8 +++++--- re2/testing/string_generator.h | 1 + re2/testing/string_generator_test.cc | 8 ++++++-- re2/testing/tester.cc | 6 +++++- re2/testing/tester.h | 2 +- re2/tostring.cc | 4 ++-- 60 files changed, 207 insertions(+), 123 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index f1ceaedf1..c765cfd51 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -83,6 +83,7 @@ cc_library( "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/container:flat_hash_set", "@abseil-cpp//absl/container:inlined_vector", + "@abseil-cpp//absl/hash", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:absl_log", "@abseil-cpp//absl/strings", @@ -165,6 +166,7 @@ cc_test( "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:absl_log", + "@abseil-cpp//absl/strings", "@googletest//:gtest", "@googletest//:gtest_main", ], @@ -239,6 +241,7 @@ cc_test( "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:absl_log", + "@abseil-cpp//absl/types:optional", "@googletest//:gtest", "@googletest//:gtest_main", ], @@ -254,6 +257,7 @@ cc_test( "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:absl_log", + "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@googletest//:gtest", "@googletest//:gtest_main", @@ -333,6 +337,7 @@ cc_test( srcs = ["re2/testing/string_generator_test.cc"], deps = [ ":testing", + "@abseil-cpp//absl/strings", "@googletest//:gtest", "@googletest//:gtest_main", ], @@ -349,6 +354,7 @@ cc_test( "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:absl_log", + "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@googletest//:gtest", "@googletest//:gtest_main", @@ -423,6 +429,7 @@ cc_binary( "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:absl_log", + "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@abseil-cpp//absl/synchronization", "@google_benchmark//:benchmark_main", diff --git a/CMakeLists.txt b/CMakeLists.txt index b838a3a0a..a2ade77a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,7 @@ set(ABSL_DEPS absl_flags absl_flat_hash_map absl_flat_hash_set + absl_hash absl_inlined_vector absl_optional absl_span diff --git a/Makefile b/Makefile index 887d82d29..e01529b2e 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ ABSL_DEPS=\ absl_flags\ absl_flat_hash_map\ absl_flat_hash_set\ + absl_hash\ absl_inlined_vector\ absl_optional\ absl_span\ diff --git a/python/_re2.cc b/python/_re2.cc index 07e33cec2..385492d88 100644 --- a/python/_re2.cc +++ b/python/_re2.cc @@ -2,15 +2,21 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include +#include + #include +#include #include #include #include #include -#include -#include #include "absl/strings/string_view.h" +#include "pybind11/buffer_info.h" +#include "pybind11/gil.h" +#include "pybind11/pybind11.h" +#include "pybind11/pytypes.h" #include "re2/filtered_re2.h" #include "re2/re2.h" #include "re2/set.h" diff --git a/re2/bitmap256.cc b/re2/bitmap256.cc index fe2ba7e4a..4b9eee430 100644 --- a/re2/bitmap256.cc +++ b/re2/bitmap256.cc @@ -6,9 +6,8 @@ #include -#include "absl/base/macros.h" +#include "absl/base/attributes.h" #include "absl/log/absl_check.h" -#include "absl/log/absl_log.h" namespace re2 { diff --git a/re2/bitmap256.h b/re2/bitmap256.h index 45913a615..e16a570a5 100644 --- a/re2/bitmap256.h +++ b/re2/bitmap256.h @@ -5,15 +5,16 @@ #ifndef RE2_BITMAP256_H_ #define RE2_BITMAP256_H_ -#ifdef _MSC_VER -#include -#endif #include #include #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#ifdef _MSC_VER +#include +#endif + namespace re2 { class Bitmap256 { diff --git a/re2/bitstate.cc b/re2/bitstate.cc index e69c1067e..71f41c383 100644 --- a/re2/bitstate.cc +++ b/re2/bitstate.cc @@ -20,11 +20,13 @@ #include #include #include + #include #include #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/regexp.h" diff --git a/re2/compile.cc b/re2/compile.cc index ce3c32e23..95c1b32dd 100644 --- a/re2/compile.cc +++ b/re2/compile.cc @@ -10,18 +10,20 @@ #include #include + +#include #include -#include "absl/base/macros.h" #include "absl/container/flat_hash_map.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" -#include "util/utf.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/re2.h" #include "re2/regexp.h" #include "re2/walker-inl.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/dfa.cc b/re2/dfa.cc index 808f87242..1619614ea 100644 --- a/re2/dfa.cc +++ b/re2/dfa.cc @@ -25,29 +25,32 @@ #include #include #include + #include #include #include -#include +#include #include #include #include +#include "absl/base/attributes.h" #include "absl/base/call_once.h" -#include "absl/base/macros.h" #include "absl/base/thread_annotations.h" #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" +#include "absl/hash/hash.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "absl/synchronization/mutex.h" #include "absl/types/span.h" -#include "util/strutil.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/re2.h" #include "re2/sparse_set.h" +#include "util/strutil.h" // Silence "zero-sized array in struct/union" warning for DFA::State::next_. #ifdef _MSC_VER diff --git a/re2/filtered_re2.cc b/re2/filtered_re2.cc index 78e4a5675..f0995a10b 100644 --- a/re2/filtered_re2.cc +++ b/re2/filtered_re2.cc @@ -5,11 +5,13 @@ #include "re2/filtered_re2.h" #include + #include #include +#include -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#include "absl/strings/string_view.h" #include "re2/prefilter.h" #include "re2/prefilter_tree.h" diff --git a/re2/fuzzing/re2_fuzzer.cc b/re2/fuzzing/re2_fuzzer.cc index 9a7af08a7..8a8c2acc8 100644 --- a/re2/fuzzing/re2_fuzzer.cc +++ b/re2/fuzzing/re2_fuzzer.cc @@ -5,10 +5,12 @@ #include #include #include + #include #include #include +#include "absl/strings/string_view.h" #include "re2/filtered_re2.h" #include "re2/re2.h" #include "re2/regexp.h" diff --git a/re2/mimics_pcre.cc b/re2/mimics_pcre.cc index 43860a6a1..172406366 100644 --- a/re2/mimics_pcre.cc +++ b/re2/mimics_pcre.cc @@ -22,7 +22,6 @@ // // Regexp::MimicsPCRE checks for any of these conditions. -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "re2/regexp.h" #include "re2/walker-inl.h" diff --git a/re2/nfa.cc b/re2/nfa.cc index 9ad522c91..a35976f25 100644 --- a/re2/nfa.cc +++ b/re2/nfa.cc @@ -26,15 +26,16 @@ #include #include + #include #include #include #include -#include #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/regexp.h" diff --git a/re2/onepass.cc b/re2/onepass.cc index 20edd111d..fb7f69431 100644 --- a/re2/onepass.cc +++ b/re2/onepass.cc @@ -52,20 +52,21 @@ #include #include + #include #include #include -#include #include "absl/container/fixed_array.h" #include "absl/container/inlined_vector.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" -#include "util/utf.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/sparse_set.h" +#include "util/utf.h" // Silence "zero-sized array in struct/union" warning for OneState::action. #ifdef _MSC_VER diff --git a/re2/parse.cc b/re2/parse.cc index 6b30bcf38..6f7a5612f 100644 --- a/re2/parse.cc +++ b/re2/parse.cc @@ -16,25 +16,25 @@ // and recognizes the Perl escape sequences \d, \s, \w, \D, \S, and \W. // See regexp.h for rationale. -#include #include #include #include + #include -#include #include #include +#include "absl/base/attributes.h" #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/ascii.h" -#include "util/utf.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/regexp.h" #include "re2/unicode_casefold.h" #include "re2/unicode_groups.h" #include "re2/walker-inl.h" +#include "util/utf.h" #if defined(RE2_USE_ICU) #include "unicode/uniset.h" diff --git a/re2/prefilter.cc b/re2/prefilter.cc index 529b58ced..decc412ba 100644 --- a/re2/prefilter.cc +++ b/re2/prefilter.cc @@ -5,7 +5,7 @@ #include "re2/prefilter.h" #include -#include + #include #include #include @@ -13,10 +13,11 @@ #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" -#include "util/utf.h" #include "re2/re2.h" +#include "re2/regexp.h" #include "re2/unicode_casefold.h" #include "re2/walker-inl.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/prefilter_tree.cc b/re2/prefilter_tree.cc index e59608684..0a7bea984 100644 --- a/re2/prefilter_tree.cc +++ b/re2/prefilter_tree.cc @@ -5,9 +5,9 @@ #include "re2/prefilter_tree.h" #include + #include #include -#include #include #include #include @@ -16,7 +16,6 @@ #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" #include "re2/prefilter.h" -#include "re2/re2.h" namespace re2 { diff --git a/re2/prog.cc b/re2/prog.cc index 277de2602..d3ff26eff 100644 --- a/re2/prog.cc +++ b/re2/prog.cc @@ -7,23 +7,30 @@ #include "re2/prog.h" -#if defined(__AVX2__) -#include -#ifdef _MSC_VER -#include -#endif -#endif #include #include + #include -#include +#include #include +#include -#include "absl/base/macros.h" +#include "absl/base/attributes.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "re2/bitmap256.h" +#include "re2/pod_array.h" +#include "re2/sparse_array.h" +#include "re2/sparse_set.h" + +#if defined(__AVX2__) +#include +#ifdef _MSC_VER +#include +#endif +#endif namespace re2 { diff --git a/re2/prog.h b/re2/prog.h index 6851832cb..d0889bdca 100644 --- a/re2/prog.h +++ b/re2/prog.h @@ -10,10 +10,11 @@ // expression symbolically. #include + #include #include -#include #include +#include #include "absl/base/call_once.h" #include "absl/log/absl_check.h" diff --git a/re2/re2.cc b/re2/re2.cc index 74b75265b..2e25b64f3 100644 --- a/re2/re2.cc +++ b/re2/re2.cc @@ -9,32 +9,36 @@ #include "re2/re2.h" -#include #include -#ifdef _MSC_VER -#include -#endif +#include #include #include #include + #include #include -#include +#include #include #include #include +#include "absl/base/call_once.h" #include "absl/base/macros.h" #include "absl/container/fixed_array.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/ascii.h" #include "absl/strings/str_format.h" -#include "util/strutil.h" -#include "util/utf.h" +#include "absl/strings/string_view.h" #include "re2/prog.h" #include "re2/regexp.h" #include "re2/sparse_array.h" +#include "util/strutil.h" +#include "util/utf.h" + +#ifdef _MSC_VER +#include +#endif namespace re2 { diff --git a/re2/re2.h b/re2/re2.h index 0f859a179..d797bc040 100644 --- a/re2/re2.h +++ b/re2/re2.h @@ -210,21 +210,22 @@ #include #include + #include #include #include #include #include -#if defined(__APPLE__) -#include -#endif - #include "absl/base/call_once.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "re2/stringpiece.h" +#if defined(__APPLE__) +#include +#endif + namespace re2 { class Prog; class Regexp; diff --git a/re2/regexp.cc b/re2/regexp.cc index d07756164..1e5ae9071 100644 --- a/re2/regexp.cc +++ b/re2/regexp.cc @@ -10,6 +10,7 @@ #include #include #include + #include #include #include @@ -21,9 +22,9 @@ #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/synchronization/mutex.h" -#include "util/utf.h" #include "re2/pod_array.h" #include "re2/walker-inl.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/regexp.h b/re2/regexp.h index a782b2a6e..531b42044 100644 --- a/re2/regexp.h +++ b/re2/regexp.h @@ -88,6 +88,7 @@ #include #include + #include #include #include diff --git a/re2/set.cc b/re2/set.cc index b6ff03019..caebd24e4 100644 --- a/re2/set.cc +++ b/re2/set.cc @@ -5,16 +5,20 @@ #include "re2/set.h" #include + #include #include +#include #include +#include -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/re2.h" #include "re2/regexp.h" +#include "re2/sparse_set.h" namespace re2 { diff --git a/re2/simplify.cc b/re2/simplify.cc index b88093605..d0524aff5 100644 --- a/re2/simplify.cc +++ b/re2/simplify.cc @@ -6,15 +6,17 @@ // to use simple extended regular expression features. // Also sort and simplify character classes. +#include + #include #include -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" -#include "util/utf.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/regexp.h" #include "re2/walker-inl.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/sparse_array.h b/re2/sparse_array.h index 09ffe086b..8174d9a0a 100644 --- a/re2/sparse_array.h +++ b/re2/sparse_array.h @@ -88,21 +88,23 @@ // // A moved-from SparseArray will be empty. +#include +#include + +#include +#include +#include + +#include "re2/pod_array.h" + // Doing this simplifies the logic below. #ifndef __has_feature #define __has_feature(x) 0 #endif -#include -#include #if __has_feature(memory_sanitizer) #include #endif -#include -#include -#include - -#include "re2/pod_array.h" namespace re2 { diff --git a/re2/sparse_set.h b/re2/sparse_set.h index 06ed88d81..c08e93d29 100644 --- a/re2/sparse_set.h +++ b/re2/sparse_set.h @@ -47,21 +47,23 @@ // // See sparse_array.h for implementation details. +#include +#include + +#include +#include +#include + +#include "re2/pod_array.h" + // Doing this simplifies the logic below. #ifndef __has_feature #define __has_feature(x) 0 #endif -#include -#include #if __has_feature(memory_sanitizer) #include #endif -#include -#include -#include - -#include "re2/pod_array.h" namespace re2 { diff --git a/re2/testing/backtrack.cc b/re2/testing/backtrack.cc index 790a50d02..7504e1a46 100644 --- a/re2/testing/backtrack.cc +++ b/re2/testing/backtrack.cc @@ -30,6 +30,7 @@ #include "absl/base/macros.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#include "absl/strings/string_view.h" #include "re2/pod_array.h" #include "re2/prog.h" #include "re2/regexp.h" diff --git a/re2/testing/charclass_test.cc b/re2/testing/charclass_test.cc index ad95d6c26..efe38aec1 100644 --- a/re2/testing/charclass_test.cc +++ b/re2/testing/charclass_test.cc @@ -9,8 +9,8 @@ #include "absl/base/macros.h" #include "absl/strings/str_format.h" #include "gtest/gtest.h" -#include "util/utf.h" #include "re2/regexp.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/testing/compile_test.cc b/re2/testing/compile_test.cc index 2f7a94d51..7ac01f9b1 100644 --- a/re2/testing/compile_test.cc +++ b/re2/testing/compile_test.cc @@ -4,14 +4,16 @@ // Test prog.cc, compile.cc +#include + #include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "re2/regexp.h" #include "re2/prog.h" +#include "re2/regexp.h" namespace re2 { diff --git a/re2/testing/dfa_test.cc b/re2/testing/dfa_test.cc index 1b8f0f28c..a8178c889 100644 --- a/re2/testing/dfa_test.cc +++ b/re2/testing/dfa_test.cc @@ -2,23 +2,24 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include #include + #include #include #include #include "absl/base/macros.h" #include "absl/flags/flag.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "util/malloc_counter.h" #include "re2/prog.h" #include "re2/re2.h" #include "re2/regexp.h" -#include "re2/testing/regexp_generator.h" #include "re2/testing/string_generator.h" +#include "util/malloc_counter.h" static const bool UsingMallocCounter = false; diff --git a/re2/testing/dump.cc b/re2/testing/dump.cc index 9beda81d5..382ac208a 100644 --- a/re2/testing/dump.cc +++ b/re2/testing/dump.cc @@ -23,8 +23,8 @@ #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" #include "gtest/gtest.h" -#include "util/utf.h" #include "re2/regexp.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/testing/exhaustive1_test.cc b/re2/testing/exhaustive1_test.cc index 933798995..0056cf232 100644 --- a/re2/testing/exhaustive1_test.cc +++ b/re2/testing/exhaustive1_test.cc @@ -9,6 +9,7 @@ #include "gtest/gtest.h" #include "re2/testing/exhaustive_tester.h" +#include "re2/testing/regexp_generator.h" namespace re2 { diff --git a/re2/testing/exhaustive2_test.cc b/re2/testing/exhaustive2_test.cc index 14f629d4a..31079fb38 100644 --- a/re2/testing/exhaustive2_test.cc +++ b/re2/testing/exhaustive2_test.cc @@ -5,12 +5,13 @@ // Exhaustive testing of regular expression matching. #include -#include + #include #include #include "gtest/gtest.h" #include "re2/testing/exhaustive_tester.h" +#include "re2/testing/regexp_generator.h" namespace re2 { @@ -69,4 +70,3 @@ TEST(LineEnds, Exhaustive) { // } } // namespace re2 - diff --git a/re2/testing/exhaustive3_test.cc b/re2/testing/exhaustive3_test.cc index de703c00e..afc387f9a 100644 --- a/re2/testing/exhaustive3_test.cc +++ b/re2/testing/exhaustive3_test.cc @@ -5,13 +5,14 @@ // Exhaustive testing of regular expression matching. #include -#include + #include #include #include "gtest/gtest.h" -#include "util/utf.h" #include "re2/testing/exhaustive_tester.h" +#include "re2/testing/regexp_generator.h" +#include "util/utf.h" namespace re2 { @@ -97,4 +98,3 @@ TEST(InterestingUTF8, AB) { } } // namespace re2 - diff --git a/re2/testing/exhaustive_test.cc b/re2/testing/exhaustive_test.cc index 5e586f1fe..1bae2f3c7 100644 --- a/re2/testing/exhaustive_test.cc +++ b/re2/testing/exhaustive_test.cc @@ -33,4 +33,3 @@ TEST(EgrepLiterals, UTF8) { } } // namespace re2 - diff --git a/re2/testing/exhaustive_tester.cc b/re2/testing/exhaustive_tester.cc index 7d63be902..d8fa1ffa8 100644 --- a/re2/testing/exhaustive_tester.cc +++ b/re2/testing/exhaustive_tester.cc @@ -11,15 +11,23 @@ // the NFA, DFA, and a trivial backtracking implementation agree about // the location of the match. +#include "re2/testing/exhaustive_tester.h" + #include +#include +#include + #include "absl/base/macros.h" #include "absl/flags/flag.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "re2/testing/exhaustive_tester.h" +#include "re2/prog.h" +#include "re2/re2.h" +#include "re2/testing/regexp_generator.h" #include "re2/testing/tester.h" // For target `log' in the Makefile. diff --git a/re2/testing/exhaustive_tester.h b/re2/testing/exhaustive_tester.h index 906be0c8c..8b0421d71 100644 --- a/re2/testing/exhaustive_tester.h +++ b/re2/testing/exhaustive_tester.h @@ -6,6 +6,7 @@ #define RE2_TESTING_EXHAUSTIVE_TESTER_H_ #include + #include #include diff --git a/re2/testing/filtered_re2_test.cc b/re2/testing/filtered_re2_test.cc index 172389d9e..b951d7c7f 100644 --- a/re2/testing/filtered_re2_test.cc +++ b/re2/testing/filtered_re2_test.cc @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include "re2/filtered_re2.h" + #include + #include -#include #include -#include #include +#include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "gtest/gtest.h" -#include "re2/filtered_re2.h" #include "re2/re2.h" namespace re2 { diff --git a/re2/testing/mimics_pcre_test.cc b/re2/testing/mimics_pcre_test.cc index 72e7feea5..36a348f02 100644 --- a/re2/testing/mimics_pcre_test.cc +++ b/re2/testing/mimics_pcre_test.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include + #include "absl/base/macros.h" -#include "absl/log/absl_check.h" -#include "absl/log/absl_log.h" #include "gtest/gtest.h" #include "re2/prog.h" #include "re2/regexp.h" diff --git a/re2/testing/null_walker.cc b/re2/testing/null_walker.cc index da54c28b8..3e17bc39e 100644 --- a/re2/testing/null_walker.cc +++ b/re2/testing/null_walker.cc @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" -#include "gtest/gtest.h" #include "re2/regexp.h" #include "re2/walker-inl.h" diff --git a/re2/testing/parse_test.cc b/re2/testing/parse_test.cc index e7838953e..53ef24ec7 100644 --- a/re2/testing/parse_test.cc +++ b/re2/testing/parse_test.cc @@ -4,10 +4,11 @@ // Test parse.cc, dump.cc, and tostring.cc. +#include + #include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "gtest/gtest.h" #include "re2/regexp.h" diff --git a/re2/testing/possible_match_test.cc b/re2/testing/possible_match_test.cc index e6073ef0d..f217947d6 100644 --- a/re2/testing/possible_match_test.cc +++ b/re2/testing/possible_match_test.cc @@ -3,13 +3,14 @@ // license that can be found in the LICENSE file. #include + #include #include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/escaping.h" +#include "absl/strings/string_view.h" #include "gtest/gtest.h" #include "re2/prog.h" #include "re2/re2.h" diff --git a/re2/testing/random_test.cc b/re2/testing/random_test.cc index d076b39b1..6ff358762 100644 --- a/re2/testing/random_test.cc +++ b/re2/testing/random_test.cc @@ -4,7 +4,6 @@ // Random testing of regular expression matching. -#include #include #include @@ -12,6 +11,7 @@ #include "absl/strings/str_format.h" #include "gtest/gtest.h" #include "re2/testing/exhaustive_tester.h" +#include "re2/testing/regexp_generator.h" ABSL_FLAG(int, regexpseed, 404, "Random regexp seed."); ABSL_FLAG(int, regexpcount, 100, "How many random regexps to generate."); diff --git a/re2/testing/re2_arg_test.cc b/re2/testing/re2_arg_test.cc index db1868aeb..c895c30a9 100644 --- a/re2/testing/re2_arg_test.cc +++ b/re2/testing/re2_arg_test.cc @@ -11,8 +11,8 @@ #include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" +#include "absl/types/optional.h" #include "gtest/gtest.h" #include "re2/re2.h" diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc index 0a602070f..d46666bea 100644 --- a/re2/testing/re2_test.cc +++ b/re2/testing/re2_test.cc @@ -5,27 +5,30 @@ // TODO: Test extractions for PartialMatch/Consume +#include "re2/re2.h" + #include #include #include #include + #include #include #include #include -#if !defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MINGW32__) -#include -#include /* for sysconf */ -#endif #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "re2/re2.h" #include "re2/regexp.h" +#if !defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MINGW32__) +#include +#include +#endif + namespace re2 { TEST(RE2, HexTests) { diff --git a/re2/testing/regexp_benchmark.cc b/re2/testing/regexp_benchmark.cc index 33211fe0d..3b0a5330b 100644 --- a/re2/testing/regexp_benchmark.cc +++ b/re2/testing/regexp_benchmark.cc @@ -7,21 +7,22 @@ #include #include #include + #include #include -#include #include "absl/container/flat_hash_map.h" #include "absl/flags/flag.h" #include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "absl/synchronization/mutex.h" #include "benchmark/benchmark.h" -#include "util/malloc_counter.h" #include "re2/prog.h" #include "re2/re2.h" #include "re2/regexp.h" +#include "util/malloc_counter.h" #include "util/pcre.h" namespace re2 { diff --git a/re2/testing/regexp_generator.cc b/re2/testing/regexp_generator.cc index baf73d2d3..a702e7d83 100644 --- a/re2/testing/regexp_generator.cc +++ b/re2/testing/regexp_generator.cc @@ -20,11 +20,15 @@ // Then RunPostfix turns each sequence into a regular expression // and passes the regexp to HandleRegexp. +#include "re2/testing/regexp_generator.h" + #include #include #include #include + #include +#include #include #include #include @@ -34,9 +38,8 @@ #include "absl/log/absl_log.h" #include "absl/strings/escaping.h" #include "absl/strings/str_format.h" -#include "gtest/gtest.h" +#include "absl/strings/string_view.h" #include "util/utf.h" -#include "re2/testing/regexp_generator.h" namespace re2 { diff --git a/re2/testing/regexp_generator.h b/re2/testing/regexp_generator.h index e1be1a93d..bb2128da8 100644 --- a/re2/testing/regexp_generator.h +++ b/re2/testing/regexp_generator.h @@ -9,6 +9,7 @@ // regular expressions within given parameters (see below for details). #include + #include #include #include diff --git a/re2/testing/regexp_test.cc b/re2/testing/regexp_test.cc index 1403a7477..e971bd0b3 100644 --- a/re2/testing/regexp_test.cc +++ b/re2/testing/regexp_test.cc @@ -4,15 +4,15 @@ // Test parse.cc, dump.cc, and tostring.cc. +#include "re2/regexp.h" + #include + #include #include #include -#include "absl/log/absl_check.h" -#include "absl/log/absl_log.h" #include "gtest/gtest.h" -#include "re2/regexp.h" namespace re2 { diff --git a/re2/testing/required_prefix_test.cc b/re2/testing/required_prefix_test.cc index bf46f7aa1..ab7f4121f 100644 --- a/re2/testing/required_prefix_test.cc +++ b/re2/testing/required_prefix_test.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include + #include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" -#include "absl/log/absl_log.h" #include "gtest/gtest.h" #include "re2/prog.h" #include "re2/regexp.h" diff --git a/re2/testing/search_test.cc b/re2/testing/search_test.cc index 166652a2d..0d0cb78b1 100644 --- a/re2/testing/search_test.cc +++ b/re2/testing/search_test.cc @@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include + +#include +#include + #include "absl/base/macros.h" #include "gtest/gtest.h" -#include "re2/prog.h" -#include "re2/regexp.h" -#include "re2/testing/tester.h" #include "re2/testing/exhaustive_tester.h" +#include "re2/testing/tester.h" // For target `log' in the Makefile. #ifndef LOGGING diff --git a/re2/testing/set_test.cc b/re2/testing/set_test.cc index f8d301887..5962295e2 100644 --- a/re2/testing/set_test.cc +++ b/re2/testing/set_test.cc @@ -2,16 +2,15 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include "re2/set.h" + #include -#include -#include + #include +#include -#include "absl/log/absl_check.h" -#include "absl/log/absl_log.h" #include "gtest/gtest.h" #include "re2/re2.h" -#include "re2/set.h" namespace re2 { diff --git a/re2/testing/simplify_test.cc b/re2/testing/simplify_test.cc index 9c4e38c14..efbe96745 100644 --- a/re2/testing/simplify_test.cc +++ b/re2/testing/simplify_test.cc @@ -5,10 +5,8 @@ // Test simplify.cc. #include -#include #include "absl/base/macros.h" -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "gtest/gtest.h" #include "re2/regexp.h" diff --git a/re2/testing/string_generator.cc b/re2/testing/string_generator.cc index 24397df1b..6e450a942 100644 --- a/re2/testing/string_generator.cc +++ b/re2/testing/string_generator.cc @@ -6,15 +6,17 @@ // maxlen letters using the set of letters in alpha. // Fetch strings using a Java-like Next()/HasNext() interface. +#include "re2/testing/string_generator.h" + #include #include + +#include #include #include #include "absl/log/absl_check.h" -#include "absl/log/absl_log.h" -#include "gtest/gtest.h" -#include "re2/testing/string_generator.h" +#include "absl/strings/string_view.h" namespace re2 { diff --git a/re2/testing/string_generator.h b/re2/testing/string_generator.h index 0d6f5fcba..acdb3d5f1 100644 --- a/re2/testing/string_generator.h +++ b/re2/testing/string_generator.h @@ -10,6 +10,7 @@ // Fetch strings using a Java-like Next()/HasNext() interface. #include + #include #include #include diff --git a/re2/testing/string_generator_test.cc b/re2/testing/string_generator_test.cc index b1273d9f6..62868d507 100644 --- a/re2/testing/string_generator_test.cc +++ b/re2/testing/string_generator_test.cc @@ -4,13 +4,17 @@ // Test StringGenerator. +#include "re2/testing/string_generator.h" + +#include #include + #include +#include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "util/utf.h" -#include "re2/testing/string_generator.h" #include "re2/testing/regexp_generator.h" +#include "util/utf.h" namespace re2 { diff --git a/re2/testing/tester.cc b/re2/testing/tester.cc index fc68a8a5a..72925e392 100644 --- a/re2/testing/tester.cc +++ b/re2/testing/tester.cc @@ -4,9 +4,12 @@ // Regular expression engine tester -- test all the implementations against each other. +#include "re2/testing/tester.h" + #include #include #include + #include #include "absl/base/macros.h" @@ -15,10 +18,11 @@ #include "absl/log/absl_log.h" #include "absl/strings/escaping.h" #include "absl/strings/str_format.h" -#include "re2/testing/tester.h" +#include "absl/strings/string_view.h" #include "re2/prog.h" #include "re2/re2.h" #include "re2/regexp.h" +#include "util/pcre.h" ABSL_FLAG(bool, dump_prog, false, "dump regexp program"); ABSL_FLAG(bool, log_okay, false, "log successful runs"); diff --git a/re2/testing/tester.h b/re2/testing/tester.h index 59be5ea0a..9a87138e8 100644 --- a/re2/testing/tester.h +++ b/re2/testing/tester.h @@ -12,8 +12,8 @@ #include "absl/strings/string_view.h" #include "re2/prog.h" -#include "re2/regexp.h" #include "re2/re2.h" +#include "re2/regexp.h" #include "util/pcre.h" namespace re2 { diff --git a/re2/tostring.cc b/re2/tostring.cc index c1ec69926..24a530e64 100644 --- a/re2/tostring.cc +++ b/re2/tostring.cc @@ -6,14 +6,14 @@ // Tested by parse_test.cc #include + #include -#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" #include "absl/strings/str_format.h" -#include "util/utf.h" #include "re2/regexp.h" #include "re2/walker-inl.h" +#include "util/utf.h" namespace re2 {