From 507a671e7d84fda9a5d34580bcce4eb235f5acf5 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Tue, 3 May 2022 16:15:43 +0000 Subject: [PATCH] tint: Fix indentation in code templates 41e4d9a34 adjusted the tab indentation from 2 to 4 whitespaces. Apply this to the templates so that regenerating these produce no diffs. Bug: dawn:1339 Change-Id: Ib49e0d72b563558fbe2120d3db5754716eb1a4f6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88663 Reviewed-by: Dan Sinclair Kokoro: Kokoro Commit-Queue: Ben Clayton --- src/tint/sem/builtin_type.cc.tmpl | 26 +++++++++++++------------- src/tint/sem/builtin_type.h.tmpl | 4 ++-- src/tint/sem/parameter_usage.cc.tmpl | 14 +++++++------- src/tint/sem/parameter_usage.h.tmpl | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/tint/sem/builtin_type.cc.tmpl b/src/tint/sem/builtin_type.cc.tmpl index ab072d92cf..2330c87bd9 100644 --- a/src/tint/sem/builtin_type.cc.tmpl +++ b/src/tint/sem/builtin_type.cc.tmpl @@ -16,28 +16,28 @@ namespace tint::sem { BuiltinType ParseBuiltinType(const std::string& name) { {{- range .Sem.Functions }} - if (name == "{{.Name}}") { - return BuiltinType::k{{Title .Name}}; - } + if (name == "{{.Name}}") { + return BuiltinType::k{{Title .Name}}; + } {{- end }} - return BuiltinType::kNone; + return BuiltinType::kNone; } const char* str(BuiltinType i) { - switch (i) { - case BuiltinType::kNone: - return ""; + switch (i) { + case BuiltinType::kNone: + return ""; {{- range .Sem.Functions }} - case BuiltinType::k{{Title .Name}}: - return "{{.Name}}"; + case BuiltinType::k{{Title .Name}}: + return "{{.Name}}"; {{- end }} - } - return ""; + } + return ""; } std::ostream& operator<<(std::ostream& out, BuiltinType i) { - out << str(i); - return out; + out << str(i); + return out; } } // namespace tint::sem diff --git a/src/tint/sem/builtin_type.h.tmpl b/src/tint/sem/builtin_type.h.tmpl index 7b018df53a..b601c37ade 100644 --- a/src/tint/sem/builtin_type.h.tmpl +++ b/src/tint/sem/builtin_type.h.tmpl @@ -18,9 +18,9 @@ namespace tint::sem { /// Enumerator of all builtin functions enum class BuiltinType { - kNone = -1, + kNone = -1, {{- range .Sem.Functions }} - k{{Title .Name}}, + k{{Title .Name}}, {{- end }} }; diff --git a/src/tint/sem/parameter_usage.cc.tmpl b/src/tint/sem/parameter_usage.cc.tmpl index 1339171d6c..bb767d428f 100644 --- a/src/tint/sem/parameter_usage.cc.tmpl +++ b/src/tint/sem/parameter_usage.cc.tmpl @@ -13,15 +13,15 @@ See: namespace tint::sem { const char* str(ParameterUsage usage) { - switch (usage) { - case ParameterUsage::kNone: - return "none"; + switch (usage) { + case ParameterUsage::kNone: + return "none"; {{- range .Sem.UniqueParameterNames }} - case ParameterUsage::k{{PascalCase .}}: - return "{{.}}"; + case ParameterUsage::k{{PascalCase .}}: + return "{{.}}"; {{- end }} - } - return ""; + } + return ""; } } // namespace tint::sem diff --git a/src/tint/sem/parameter_usage.h.tmpl b/src/tint/sem/parameter_usage.h.tmpl index 1edb674ad4..f7a3c282d0 100644 --- a/src/tint/sem/parameter_usage.h.tmpl +++ b/src/tint/sem/parameter_usage.h.tmpl @@ -16,9 +16,9 @@ namespace tint::sem { /// ParameterUsage is extra metadata for identifying a parameter based on its /// overload position enum class ParameterUsage { - kNone = -1, + kNone = -1, {{- range .Sem.UniqueParameterNames }} - k{{PascalCase .}}, + k{{PascalCase .}}, {{- end }} };