From 4168cda2363f3d796d0b9922852e249aac3131ba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Dec 2020 08:39:35 +0200 Subject: Mark Buildfile functions as pure or impure --- libbuild2/functions-regex.cxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'libbuild2/functions-regex.cxx') diff --git a/libbuild2/functions-regex.cxx b/libbuild2/functions-regex.cxx index a59d808..46d71ba 100644 --- a/libbuild2/functions-regex.cxx +++ b/libbuild2/functions-regex.cxx @@ -521,12 +521,12 @@ namespace build2 // sub-strings that match the marked sub-expressions and // NULL if no match // - f[".match"] = [](value s, string re, optional flags) + f[".match"] += [](value s, string re, optional flags) { return match (move (s), re, move (flags)); }; - f[".match"] = [](value s, names re, optional flags) + f[".match"] += [](value s, names re, optional flags) { return match (move (s), convert (move (re)), move (flags)); }; @@ -540,12 +540,12 @@ namespace build2 // // icase - match ignoring case // - f[".find_match"] = [](names s, string re, optional flags) + f[".find_match"] += [](names s, string re, optional flags) { return find_match (move (s), re, move (flags)); }; - f[".find_match"] = [](names s, names re, optional flags) + f[".find_match"] += [](names s, names re, optional flags) { return find_match (move (s), convert (move (re)), move (flags)); }; @@ -573,12 +573,12 @@ namespace build2 // If both return_match and return_subs flags are specified then the // sub-string that matches the whole regular expression comes first. // - f[".search"] = [](value s, string re, optional flags) + f[".search"] += [](value s, string re, optional flags) { return search (move (s), re, move (flags)); }; - f[".search"] = [](value s, names re, optional flags) + f[".search"] += [](value s, names re, optional flags) { return search (move (s), convert (move (re)), move (flags)); }; @@ -593,12 +593,12 @@ namespace build2 // // icase - match ignoring case // - f[".find_search"] = [](names s, string re, optional flags) + f[".find_search"] += [](names s, string re, optional flags) { return find_search (move (s), re, move (flags)); }; - f[".find_search"] = [](names s, names re, optional flags) + f[".find_search"] += [](names s, names re, optional flags) { return find_search (move (s), convert (move (re)), @@ -625,12 +625,12 @@ namespace build2 // If both format_first_only and format_no_copy flags are specified then // the result will only contain the replacement of the first match. // - f[".replace"] = [](value s, string re, string fmt, optional flags) + f[".replace"] += [](value s, string re, string fmt, optional flags) { return replace (move (s), re, fmt, move (flags)); }; - f[".replace"] = [](value s, names re, names fmt, optional flags) + f[".replace"] += [](value s, names re, names fmt, optional flags) { return replace (move (s), convert (move (re)), @@ -658,7 +658,7 @@ namespace build2 // Note that if format_no_copy is specified, unmatched lines are not // copied either. // - f[".replace_lines"] = [](value s, + f[".replace_lines"] += [](value s, string re, string fmt, optional flags) @@ -666,7 +666,7 @@ namespace build2 return replace_lines (move (s), re, move (fmt), move (flags)); }; - f[".replace_lines"] = [](value s, + f[".replace_lines"] += [](value s, names re, names* fmt, optional flags) @@ -695,12 +695,12 @@ namespace build2 // // format_no_copy - do not copy unmatched value parts into the result // - f[".split"] = [](value s, string re, string fmt, optional flags) + f[".split"] += [](value s, string re, string fmt, optional flags) { return split (move (s), re, fmt, move (flags)); }; - f[".split"] = [](value s, names re, names fmt, optional flags) + f[".split"] += [](value s, names re, names fmt, optional flags) { return split (move (s), convert (move (re)), @@ -730,7 +730,7 @@ namespace build2 // the result will be a concatenation of only the first match // replacements. // - f[".merge"] = [](names s, + f[".merge"] += [](names s, string re, string fmt, optional delim, @@ -739,7 +739,7 @@ namespace build2 return merge (move (s), re, fmt, move (delim), move (flags)); }; - f[".merge"] = [](names s, + f[".merge"] += [](names s, names re, names fmt, optional delim, @@ -775,12 +775,12 @@ namespace build2 // the result elements will only contain the replacement of the first // match. // - f[".apply"] = [](names s, string re, string fmt, optional flags) + f[".apply"] += [](names s, string re, string fmt, optional flags) { return apply (move (s), re, fmt, move (flags)); }; - f[".apply"] = [](names s, names re, names fmt, optional flags) + f[".apply"] += [](names s, names re, names fmt, optional flags) { return apply (move (s), convert (move (re)), -- cgit v1.1