[tint] Extract out string conversion utils from utils/text

Breaks a cyclic dependency

Change-Id: If00681f1ee0b2fccc36140b19882eae9ebc90048
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/143781
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn
index d9b95c5..1f3fd4b 100644
--- a/src/tint/BUILD.gn
+++ b/src/tint/BUILD.gn
@@ -255,8 +255,8 @@
     "utils/rtti/castable.cc",
     "utils/rtti/castable.h",
     "utils/rtti/switch.h",
-    "utils/text/parse_num.cc",
-    "utils/text/parse_num.h",
+    "utils/strconv/parse_num.cc",
+    "utils/strconv/parse_num.h",
     "utils/text/string.cc",
     "utils/text/string.h",
     "utils/text/string_stream.cc",
@@ -978,8 +978,8 @@
     "lang/wgsl/helpers/check_supported_extensions.h",
     "lang/wgsl/helpers/flatten_bindings.cc",
     "lang/wgsl/helpers/flatten_bindings.h",
-    "utils/text/float_to_string.cc",
-    "utils/text/float_to_string.h",
+    "utils/strconv/float_to_string.cc",
+    "utils/strconv/float_to_string.h",
     "utils/text/text_generator.cc",
     "utils/text/text_generator.h",
   ]
@@ -1952,7 +1952,7 @@
       "lang/wgsl/helpers/append_vector_test.cc",
       "lang/wgsl/helpers/check_supported_extensions_test.cc",
       "lang/wgsl/helpers/flatten_bindings_test.cc",
-      "utils/text/float_to_string_test.cc",
+      "utils/strconv/float_to_string_test.cc",
     ]
     deps = [
       ":libtint_unittests_ast_helper",
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt
index 9825036..6c36e2d 100644
--- a/src/tint/CMakeLists.txt
+++ b/src/tint/CMakeLists.txt
@@ -560,10 +560,10 @@
   utils/rtti/castable.cc
   utils/rtti/castable.h
   utils/rtti/switch.h
-  utils/text/float_to_string.cc
-  utils/text/float_to_string.h
-  utils/text/parse_num.cc
-  utils/text/parse_num.h
+  utils/strconv/float_to_string.cc
+  utils/strconv/float_to_string.h
+  utils/strconv/parse_num.cc
+  utils/strconv/parse_num.h
   utils/text/string.cc
   utils/text/string.h
   utils/text/string_stream.cc
@@ -1166,7 +1166,7 @@
     utils/result/result_test.cc
     utils/rtti/castable_test.cc
     utils/rtti/switch_test.cc
-    utils/text/float_to_string_test.cc
+    utils/strconv/float_to_string_test.cc
     utils/text/string_stream_test.cc
     utils/text/string_test.cc
     utils/symbol/symbol_table_test.cc
diff --git a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
index 3cbb069..18e06d6 100644
--- a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
@@ -82,7 +82,7 @@
 #include "src/tint/utils/macros/defer.h"
 #include "src/tint/utils/macros/scoped_assignment.h"
 #include "src/tint/utils/rtti/switch.h"
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 #include "src/tint/utils/text/string.h"
 #include "src/tint/utils/text/string_stream.h"
 
diff --git a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
index 6699805..fa45bc8 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -81,7 +81,7 @@
 #include "src/tint/utils/macros/defer.h"
 #include "src/tint/utils/macros/scoped_assignment.h"
 #include "src/tint/utils/rtti/switch.h"
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 #include "src/tint/utils/text/string.h"
 #include "src/tint/utils/text/string_stream.h"
 
diff --git a/src/tint/lang/msl/writer/common/printer_support.cc b/src/tint/lang/msl/writer/common/printer_support.cc
index 2064778..fba9b78 100644
--- a/src/tint/lang/msl/writer/common/printer_support.cc
+++ b/src/tint/lang/msl/writer/common/printer_support.cc
@@ -28,7 +28,7 @@
 #include "src/tint/lang/core/type/vector.h"
 #include "src/tint/utils/ice/ice.h"
 #include "src/tint/utils/rtti/switch.h"
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 
 namespace tint::msl::writer {
 
diff --git a/src/tint/lang/wgsl/reader/parser/lexer.cc b/src/tint/lang/wgsl/reader/parser/lexer.cc
index 673d83d..0fcf640 100644
--- a/src/tint/lang/wgsl/reader/parser/lexer.cc
+++ b/src/tint/lang/wgsl/reader/parser/lexer.cc
@@ -27,7 +27,7 @@
 
 #include "src/tint/lang/core/builtin/number.h"
 #include "src/tint/utils/ice/ice.h"
-#include "src/tint/utils/text/parse_num.h"
+#include "src/tint/utils/strconv/parse_num.h"
 #include "src/tint/utils/text/unicode.h"
 
 namespace tint::wgsl::reader {
diff --git a/src/tint/lang/wgsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/wgsl/writer/ast_printer/ast_printer.cc
index c21bb65..73e98fe 100644
--- a/src/tint/lang/wgsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/wgsl/writer/ast_printer/ast_printer.cc
@@ -73,7 +73,7 @@
 #include "src/tint/utils/macros/scoped_assignment.h"
 #include "src/tint/utils/math/math.h"
 #include "src/tint/utils/rtti/switch.h"
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 #include "src/tint/utils/text/string.h"
 
 namespace tint::wgsl::writer {
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc b/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc
index 7d0e627..084b231 100644
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc
+++ b/src/tint/lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc
@@ -71,7 +71,7 @@
 #include "src/tint/utils/macros/scoped_assignment.h"
 #include "src/tint/utils/math/math.h"
 #include "src/tint/utils/rtti/switch.h"
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 #include "src/tint/utils/text/string.h"
 
 namespace tint::wgsl::writer {
diff --git a/src/tint/utils/cli/cli.h b/src/tint/utils/cli/cli.h
index 05f9c1f..5f72859 100644
--- a/src/tint/utils/cli/cli.h
+++ b/src/tint/utils/cli/cli.h
@@ -24,7 +24,7 @@
 #include "src/tint/utils/macros/compiler.h"
 #include "src/tint/utils/memory/block_allocator.h"
 #include "src/tint/utils/result/result.h"
-#include "src/tint/utils/text/parse_num.h"
+#include "src/tint/utils/strconv/parse_num.h"
 #include "src/tint/utils/text/string.h"
 
 namespace tint::cli {
diff --git a/src/tint/utils/text/float_to_string.cc b/src/tint/utils/strconv/float_to_string.cc
similarity index 98%
rename from src/tint/utils/text/float_to_string.cc
rename to src/tint/utils/strconv/float_to_string.cc
index 462af68..904058d 100644
--- a/src/tint/utils/text/float_to_string.cc
+++ b/src/tint/utils/strconv/float_to_string.cc
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 
 #include <cmath>
 #include <cstring>
diff --git a/src/tint/utils/text/float_to_string.h b/src/tint/utils/strconv/float_to_string.h
similarity index 92%
rename from src/tint/utils/text/float_to_string.h
rename to src/tint/utils/strconv/float_to_string.h
index dd4a2a3..783bff3 100644
--- a/src/tint/utils/text/float_to_string.h
+++ b/src/tint/utils/strconv/float_to_string.h
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef SRC_TINT_UTILS_TEXT_FLOAT_TO_STRING_H_
-#define SRC_TINT_UTILS_TEXT_FLOAT_TO_STRING_H_
+#ifndef SRC_TINT_UTILS_STRCONV_FLOAT_TO_STRING_H_
+#define SRC_TINT_UTILS_STRCONV_FLOAT_TO_STRING_H_
 
 #include <string>
 
@@ -47,4 +47,4 @@
 
 }  // namespace tint::writer
 
-#endif  // SRC_TINT_UTILS_TEXT_FLOAT_TO_STRING_H_
+#endif  // SRC_TINT_UTILS_STRCONV_FLOAT_TO_STRING_H_
diff --git a/src/tint/utils/text/float_to_string_test.cc b/src/tint/utils/strconv/float_to_string_test.cc
similarity index 99%
rename from src/tint/utils/text/float_to_string_test.cc
rename to src/tint/utils/strconv/float_to_string_test.cc
index 4b54b80..c2347ce 100644
--- a/src/tint/utils/text/float_to_string_test.cc
+++ b/src/tint/utils/strconv/float_to_string_test.cc
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "src/tint/utils/text/float_to_string.h"
+#include "src/tint/utils/strconv/float_to_string.h"
 
 #include <math.h>
 #include <cstring>
diff --git a/src/tint/utils/text/parse_num.cc b/src/tint/utils/strconv/parse_num.cc
similarity index 98%
rename from src/tint/utils/text/parse_num.cc
rename to src/tint/utils/strconv/parse_num.cc
index 4b2fac1..824e5a2 100644
--- a/src/tint/utils/text/parse_num.cc
+++ b/src/tint/utils/strconv/parse_num.cc
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "src/tint/utils/text/parse_num.h"
+#include "src/tint/utils/strconv/parse_num.h"
 
 #include <charconv>
 
diff --git a/src/tint/utils/text/parse_num.h b/src/tint/utils/strconv/parse_num.h
similarity index 96%
rename from src/tint/utils/text/parse_num.h
rename to src/tint/utils/strconv/parse_num.h
index b0416a8..17a8c6b 100644
--- a/src/tint/utils/text/parse_num.h
+++ b/src/tint/utils/strconv/parse_num.h
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef SRC_TINT_UTILS_TEXT_PARSE_NUM_H_
-#define SRC_TINT_UTILS_TEXT_PARSE_NUM_H_
+#ifndef SRC_TINT_UTILS_STRCONV_PARSE_NUM_H_
+#define SRC_TINT_UTILS_STRCONV_PARSE_NUM_H_
 
 #include <optional>
 #include <string>
@@ -130,4 +130,4 @@
 
 }  // namespace tint
 
-#endif  // SRC_TINT_UTILS_TEXT_PARSE_NUM_H_
+#endif  // SRC_TINT_UTILS_STRCONV_PARSE_NUM_H_