From 9eabbbedcf4bcf4760bb21103d591b402942e2a1 Mon Sep 17 00:00:00 2001 From: Peter Klotz Date: Thu, 1 Oct 2020 16:07:35 +0200 Subject: [PATCH] Fixed typos (mainly in comments) --- include/boost/regex/v4/basic_regex_creator.hpp | 2 +- include/boost/regex/v4/match_flags.hpp | 10 +++++----- include/boost/regex/v4/primary_transform.hpp | 2 +- include/boost/regex/v4/states.hpp | 2 +- performance/performance.cpp | 2 +- test/regress/test_deprecated.cpp | 4 ++-- test/regress/test_replace.cpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index f4b1660a..cf64fc4a 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -303,7 +303,7 @@ re_syntax_base* basic_regex_creator::append_state(syntax_element_ // set the offset to the next state in our last one: if(m_last_state) m_last_state->next.i = m_pdata->m_data.size() - getoffset(m_last_state); - // now actually extent our data: + // now actually extend our data: m_last_state = static_cast(m_pdata->m_data.extend(s)); // fill in boilerplate options in the new state: m_last_state->next.i = 0; diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp index 1f7ed255..5dc72655 100644 --- a/include/boost/regex/v4/match_flags.hpp +++ b/include/boost/regex/v4/match_flags.hpp @@ -51,7 +51,7 @@ typedef enum _match_flags match_any = match_init << 1, /* don't care what we match */ match_not_null = match_any << 1, /* string can't be null */ match_continuous = match_not_null << 1, /* each grep match must continue from */ - /* uninterupted from the previous one */ + /* uninterrupted from the previous one */ match_partial = match_continuous << 1, /* find partial matches */ match_stop = match_partial << 1, /* stop after first match (grep) V3 only */ @@ -61,7 +61,7 @@ typedef enum _match_flags match_posix = match_perl << 1, /* Use POSIX matching rules */ match_nosubs = match_posix << 1, /* don't trap marked subs */ match_extra = match_nosubs << 1, /* include full capture information for repeated captures */ - match_single_line = match_extra << 1, /* treat text as single line and ignor any \n's when matching ^ and $. */ + match_single_line = match_extra << 1, /* treat text as single line and ignore any \n's when matching ^ and $. */ match_unused1 = match_single_line << 1, /* unused */ match_unused2 = match_unused1 << 1, /* unused */ match_unused3 = match_unused2 << 1, /* unused */ @@ -70,9 +70,9 @@ typedef enum _match_flags format_perl = 0, /* perl style replacement */ format_default = 0, /* ditto. */ format_sed = match_max << 1, /* sed style replacement. */ - format_all = format_sed << 1, /* enable all extentions to sytax. */ + format_all = format_sed << 1, /* enable all extensions to syntax. */ format_no_copy = format_all << 1, /* don't copy non-matching segments. */ - format_first_only = format_no_copy << 1, /* Only replace first occurance. */ + format_first_only = format_no_copy << 1, /* Only replace first occurrence. */ format_is_if = format_first_only << 1, /* internal use only. */ format_literal = format_is_if << 1, /* treat string as a literal */ @@ -116,7 +116,7 @@ inline match_flags& operator^=(match_flags& m1, match_flags m2) #ifdef __cplusplus } /* namespace regex_constants */ /* - * import names into boost for backwards compatiblity: + * import names into boost for backwards compatibility: */ using regex_constants::match_flag_type; using regex_constants::match_default; diff --git a/include/boost/regex/v4/primary_transform.hpp b/include/boost/regex/v4/primary_transform.hpp index 3e7cac54..47d172aa 100644 --- a/include/boost/regex/v4/primary_transform.hpp +++ b/include/boost/regex/v4/primary_transform.hpp @@ -46,7 +46,7 @@ template unsigned count_chars(const S& s, charT c) { // - // Count how many occurances of character c occur + // Count how many occurrences of character c occur // in string s: if c is a delimeter between collation // fields, then this should be the same value for all // sort keys: diff --git a/include/boost/regex/v4/states.hpp b/include/boost/regex/v4/states.hpp index b56d0134..86eb02b1 100644 --- a/include/boost/regex/v4/states.hpp +++ b/include/boost/regex/v4/states.hpp @@ -161,7 +161,7 @@ A marked parenthesis. struct re_brace : public re_syntax_base { // The index to match, can be zero (don't mark the sub-expression) - // or negative (for perl style (?...) extentions): + // or negative (for perl style (?...) extensions): int index; bool icase; }; diff --git a/performance/performance.cpp b/performance/performance.cpp index 798aa330..3fb22535 100644 --- a/performance/performance.cpp +++ b/performance/performance.cpp @@ -148,7 +148,7 @@ void test_search(const char* expression, const char* text, bool isperl = false, { double time = exec_timed_test([&]() { return (*i)->find_all(text); }); report_execution_time(time, table, row, heading); - std::cout << "Search with library: " << heading << " found " << last_value_returned << " occurances.\n"; + std::cout << "Search with library: " << heading << " found " << last_value_returned << " occurrences.\n"; } } } diff --git a/test/regress/test_deprecated.cpp b/test/regress/test_deprecated.cpp index 493c02b2..d2389a2d 100644 --- a/test/regress/test_deprecated.cpp +++ b/test/regress/test_deprecated.cpp @@ -99,7 +99,7 @@ void test_deprecated(const char&, const test_regex_search_tag&) BOOST_REGEX_TEST_ERROR("Expression : \"" << expression.c_str() << "\" did not compile with the POSIX C API.", char); return; } - // try and find the first occurance: + // try and find the first occurrence: static const unsigned max_subs = 100; boost::regmatch_t matches[max_subs]; if(boost::regexecA(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0) @@ -227,7 +227,7 @@ void test_deprecated(const wchar_t&, const test_regex_search_tag&) BOOST_REGEX_TEST_ERROR("Expression : \"" << expression.c_str() << "\" did not compile with the POSIX C API.", wchar_t); return; } - // try and find the first occurance: + // try and find the first occurrence: static const unsigned max_subs = 100; boost::regmatch_t matches[max_subs]; if(boost::regexecW(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0) diff --git a/test/regress/test_replace.cpp b/test/regress/test_replace.cpp index 635e6e30..cd434e18 100644 --- a/test/regress/test_replace.cpp +++ b/test/regress/test_replace.cpp @@ -98,7 +98,7 @@ void test_replace() TEST_REGEX_REPLACE("(?a+)|(?b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all, "(?{one}A:B)C", "...ACBC,,,ACBC*ACBC?"); TEST_REGEX_REPLACE("(?a+)|(?b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all, "?{one}:B", "...B,,,B*B?"); - // move to copying unmatched data, but replace first occurance only: + // move to copying unmatched data, but replace first occurrence only: TEST_REGEX_REPLACE("a+", perl, "...aaa,,,", match_default|format_all|format_first_only, "bbb", "...bbb,,,"); TEST_REGEX_REPLACE("a+(b+)", perl, "...aaabb,,,", match_default|format_all|format_first_only, "$1", "...bb,,,"); TEST_REGEX_REPLACE("a+(b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all|format_first_only, "$1", "...bb,,,ab*abbb?");