diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-11-06 01:47:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 09:47:26 -0800 |
| commit | b118451e301d734e3e783b3acdf871f3f6ea851c (patch) | |
| tree | 277f160d31e2c442f724bc6a2d3c09fabff403ca /source/compiler-core/slang-diagnostic-sink.cpp | |
| parent | 53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff) | |
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines
* format
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/compiler-core/slang-diagnostic-sink.cpp')
| -rw-r--r-- | source/compiler-core/slang-diagnostic-sink.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/compiler-core/slang-diagnostic-sink.cpp b/source/compiler-core/slang-diagnostic-sink.cpp index 537892f08..f9a7d9c88 100644 --- a/source/compiler-core/slang-diagnostic-sink.cpp +++ b/source/compiler-core/slang-diagnostic-sink.cpp @@ -102,7 +102,9 @@ static void formatDiagnosticMessage( switch (d) { // A double dollar sign `$$` is used to emit a single `$` - case '$': sb.append('$'); break; + case '$': + sb.append('$'); + break; // A single digit means to emit the corresponding argument. // TODO: support more than 10 arguments, and add options @@ -133,7 +135,9 @@ static void formatDiagnosticMessage( } break; - default: SLANG_INVALID_OPERATION("invalid diagnostic message format"); break; + default: + SLANG_INVALID_OPERATION("invalid diagnostic message format"); + break; } spanBegin = spanEnd; @@ -759,9 +763,12 @@ const DiagnosticInfo* DiagnosticsLookup::findDiagnosticByName(const UnownedStrin const auto convention = NameConventionUtil::inferConventionFromText(slice); switch (convention) { - case NameConvention::Invalid: return nullptr; - case NameConvention::LowerCamel: return findDiagnosticByExactName(slice); - default: break; + case NameConvention::Invalid: + return nullptr; + case NameConvention::LowerCamel: + return findDiagnosticByExactName(slice); + default: + break; } StringBuilder buf; |
