[v4,02/15] Document ^_^ regex in generate_from_strings.

Message ID 20200504123416.243214-3-gprocida@google.com
State Committed
Headers
Series Simplify regex and suppression parsing. |

Commit Message

Giuliano Procida May 4, 2020, 12:34 p.m. UTC
  Following review of the change to simplify generation of symbol
whitelist regexes, this commit clarifies the purpose of the ^_^ regex
as one which will not match any string.

	* src/abg-regex.cc (generate_from_strings): Document ^_^
	regex.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-regex.cc | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Matthias Männich May 4, 2020, 12:49 p.m. UTC | #1
On Mon, May 04, 2020 at 01:34:03PM +0100, Giuliano Procida wrote:
>Following review of the change to simplify generation of symbol
>whitelist regexes, this commit clarifies the purpose of the ^_^ regex
>as one which will not match any string.
>
>	* src/abg-regex.cc (generate_from_strings): Document ^_^
>	regex.
>
>Signed-off-by: Giuliano Procida <gprocida@google.com>

Reviewed-by: Matthias Maennich <maennich@google.com>

Cheers,
Matthias

>---
> src/abg-regex.cc | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/src/abg-regex.cc b/src/abg-regex.cc
>index cf0663a2..0451d111 100644
>--- a/src/abg-regex.cc
>+++ b/src/abg-regex.cc
>@@ -69,6 +69,7 @@ std::string
> generate_from_strings(const std::vector<std::string>& strs)
> {
>   if (strs.empty())
>+    // This cute-looking regex does not match any string.
>     return "^_^";
>   std::ostringstream os;
>   std::vector<std::string>::const_iterator i = strs.begin();
>-- 
>2.26.2.526.g744177e7f7-goog
>
  
Dodji Seketeli May 11, 2020, 1:32 p.m. UTC | #2
Giuliano Procida <gprocida@google.com> a ?crit:

[...]

>  generate_from_strings(const std::vector<std::string>& strs)
>  {
>    if (strs.empty())
> +    // This cute-looking regex does not match any string.
>      return "^_^";

Cute-looking, indeed :-)

> Following review of the change to simplify generation of symbol
> whitelist regexes, this commit clarifies the purpose of the ^_^ regex
> as one which will not match any string.
>
> 	* src/abg-regex.cc (generate_from_strings): Document ^_^
> 	regex.

Applied to master, thanks!

Cheers,
  

Patch

diff --git a/src/abg-regex.cc b/src/abg-regex.cc
index cf0663a2..0451d111 100644
--- a/src/abg-regex.cc
+++ b/src/abg-regex.cc
@@ -69,6 +69,7 @@  std::string
 generate_from_strings(const std::vector<std::string>& strs)
 {
   if (strs.empty())
+    // This cute-looking regex does not match any string.
     return "^_^";
   std::ostringstream os;
   std::vector<std::string>::const_iterator i = strs.begin();