aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2024-10-22 18:39:32 -0700
committerGitHub <noreply@github.com>2024-10-22 18:39:32 -0700
commitd005be33ee776c5d788693f5c1cf4f6bc242e13c (patch)
treeb82d5a0ff25da66df2ed347745dd7441c610911f /clang/lib/Format/UnwrappedLineParser.cpp
parentb69ac31a3b858f6a77744adfa31ad53edecbdb7e (diff)
downloadllvm-d005be33ee776c5d788693f5c1cf4f6bc242e13c.zip
llvm-d005be33ee776c5d788693f5c1cf4f6bc242e13c.tar.gz
llvm-d005be33ee776c5d788693f5c1cf4f6bc242e13c.tar.bz2
[clang-format] Handle C# `goto case` constructs (#113257)
Fixes #113256.
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 0b74889..1d425ad 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -1568,6 +1568,11 @@ void UnwrappedLineParser::parseStructuralElement(
}
parseCaseLabel();
return;
+ case tok::kw_goto:
+ nextToken();
+ if (FormatTok->is(tok::kw_case))
+ nextToken();
+ break;
case tok::kw_try:
case tok::kw___try:
if (Style.isJavaScript() && Line->MustBeDeclaration) {