From: Ulya Trofimovich Date: Thu, 6 Oct 2016 13:05:34 +0000 (+0100) Subject: Renamed header and added forgotten function. X-Git-Tag: 1.0~39^2~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac292bf8ece1dd12f8f8faf6ba6d2756fe002a4e;p=re2c Renamed header and added forgotten function. --- diff --git a/re2c/Makefile.am b/re2c/Makefile.am index cc8a68dd..36b6ee66 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -66,7 +66,7 @@ SRC_HDR = \ src/util/s_to_n32_unsafe.h \ src/util/smart_ptr.h \ src/util/static_assert.h \ - src/util/strrreplace.h \ + src/util/string_utils.h \ src/util/u32lim.h \ src/util/uniq_vector.h SRC = \ diff --git a/re2c/src/codegen/emit_action.cc b/re2c/src/codegen/emit_action.cc index 3a3ce720..bc5dc4be 100644 --- a/re2c/src/codegen/emit_action.cc +++ b/re2c/src/codegen/emit_action.cc @@ -14,8 +14,7 @@ #include "src/ir/skeleton/skeleton.h" #include "src/parse/code.h" #include "src/parse/loc.h" -#include "src/util/strrreplace.h" -#include "src/util/to_string.h" +#include "src/util/string_utils.h" namespace re2c { diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index 454fefaa..ed5a741d 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -17,7 +17,7 @@ #include "src/ir/adfa/adfa.h" #include "src/ir/skeleton/skeleton.h" #include "src/util/counter.h" -#include "src/util/strrreplace.h" +#include "src/util/string_utils.h" namespace re2c { diff --git a/re2c/src/codegen/input_api.cc b/re2c/src/codegen/input_api.cc index 33cc54af..0135efd1 100644 --- a/re2c/src/codegen/input_api.cc +++ b/re2c/src/codegen/input_api.cc @@ -5,19 +5,12 @@ #include "src/codegen/input_api.h" #include "src/codegen/indent.h" #include "src/conf/opt.h" +#include "src/util/string_utils.h" #include "src/globals.h" namespace re2c { -template -static std::string to_string(const T &v) -{ - std::ostringstream s; - s << v; - return s.str(); -} - InputAPI::InputAPI () : type_ (DEFAULT) {} diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index b48e1d03..d49d8f31 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -8,7 +8,7 @@ #include "src/conf/msg.h" #include "src/conf/opt.h" #include "src/conf/warn.h" -#include "src/util/strrreplace.h" +#include "src/util/string_utils.h" #include "src/globals.h" namespace re2c diff --git a/re2c/src/util/strrreplace.h b/re2c/src/util/string_utils.h similarity index 65% rename from re2c/src/util/strrreplace.h rename to re2c/src/util/string_utils.h index 8a18fe81..65f6b85c 100644 --- a/re2c/src/util/strrreplace.h +++ b/re2c/src/util/string_utils.h @@ -1,5 +1,5 @@ -#ifndef _RE2C_UTIL_STRRREPLACE_ -#define _RE2C_UTIL_STRRREPLACE_ +#ifndef _RE2C_UTIL_STRING_UTILS_ +#define _RE2C_UTIL_STRING_UTILS_ #include #include @@ -24,6 +24,14 @@ template void strrreplace( } } +template +static std::string to_string(const T &v) +{ + std::ostringstream s; + s << v; + return s.str(); +} + } // namespace re2c -#endif // _RE2C_UTIL_STRRREPLACE_ +#endif // _RE2C_UTIL_STRING_UTILS_