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 <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-05-03 16:15:43 +00:00 committed by Dawn LUCI CQ
parent 74b8483ba4
commit 507a671e7d
4 changed files with 24 additions and 24 deletions

View File

@ -16,28 +16,28 @@ namespace tint::sem {
BuiltinType ParseBuiltinType(const std::string& name) { BuiltinType ParseBuiltinType(const std::string& name) {
{{- range .Sem.Functions }} {{- range .Sem.Functions }}
if (name == "{{.Name}}") { if (name == "{{.Name}}") {
return BuiltinType::k{{Title .Name}}; return BuiltinType::k{{Title .Name}};
} }
{{- end }} {{- end }}
return BuiltinType::kNone; return BuiltinType::kNone;
} }
const char* str(BuiltinType i) { const char* str(BuiltinType i) {
switch (i) { switch (i) {
case BuiltinType::kNone: case BuiltinType::kNone:
return "<none>"; return "<none>";
{{- range .Sem.Functions }} {{- range .Sem.Functions }}
case BuiltinType::k{{Title .Name}}: case BuiltinType::k{{Title .Name}}:
return "{{.Name}}"; return "{{.Name}}";
{{- end }} {{- end }}
} }
return "<unknown>"; return "<unknown>";
} }
std::ostream& operator<<(std::ostream& out, BuiltinType i) { std::ostream& operator<<(std::ostream& out, BuiltinType i) {
out << str(i); out << str(i);
return out; return out;
} }
} // namespace tint::sem } // namespace tint::sem

View File

@ -18,9 +18,9 @@ namespace tint::sem {
/// Enumerator of all builtin functions /// Enumerator of all builtin functions
enum class BuiltinType { enum class BuiltinType {
kNone = -1, kNone = -1,
{{- range .Sem.Functions }} {{- range .Sem.Functions }}
k{{Title .Name}}, k{{Title .Name}},
{{- end }} {{- end }}
}; };

View File

@ -13,15 +13,15 @@ See:
namespace tint::sem { namespace tint::sem {
const char* str(ParameterUsage usage) { const char* str(ParameterUsage usage) {
switch (usage) { switch (usage) {
case ParameterUsage::kNone: case ParameterUsage::kNone:
return "none"; return "none";
{{- range .Sem.UniqueParameterNames }} {{- range .Sem.UniqueParameterNames }}
case ParameterUsage::k{{PascalCase .}}: case ParameterUsage::k{{PascalCase .}}:
return "{{.}}"; return "{{.}}";
{{- end }} {{- end }}
} }
return "<unknown>"; return "<unknown>";
} }
} // namespace tint::sem } // namespace tint::sem

View File

@ -16,9 +16,9 @@ namespace tint::sem {
/// ParameterUsage is extra metadata for identifying a parameter based on its /// ParameterUsage is extra metadata for identifying a parameter based on its
/// overload position /// overload position
enum class ParameterUsage { enum class ParameterUsage {
kNone = -1, kNone = -1,
{{- range .Sem.UniqueParameterNames }} {{- range .Sem.UniqueParameterNames }}
k{{PascalCase .}}, k{{PascalCase .}},
{{- end }} {{- end }}
}; };