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 /tools/slang-cpp-extractor | |
| 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 'tools/slang-cpp-extractor')
| -rw-r--r-- | tools/slang-cpp-extractor/cpp-extractor-main.cpp | 3 | ||||
| -rw-r--r-- | tools/slang-cpp-extractor/node.h | 3 | ||||
| -rw-r--r-- | tools/slang-cpp-extractor/parser.cpp | 42 |
3 files changed, 32 insertions, 16 deletions
diff --git a/tools/slang-cpp-extractor/cpp-extractor-main.cpp b/tools/slang-cpp-extractor/cpp-extractor-main.cpp index 78ae336fa..a4573a8e4 100644 --- a/tools/slang-cpp-extractor/cpp-extractor-main.cpp +++ b/tools/slang-cpp-extractor/cpp-extractor-main.cpp @@ -107,7 +107,8 @@ static DocMarkupExtractor::SearchStyle _getSearchStyle(Node* node) { return SearchStyle::Before; } - default: break; + default: + break; } // Default is to only allow before. diff --git a/tools/slang-cpp-extractor/node.h b/tools/slang-cpp-extractor/node.h index 3590aa5ce..2c15e460d 100644 --- a/tools/slang-cpp-extractor/node.h +++ b/tools/slang-cpp-extractor/node.h @@ -117,7 +117,8 @@ public: { return true; } - default: break; + default: + break; } return false; } diff --git a/tools/slang-cpp-extractor/parser.cpp b/tools/slang-cpp-extractor/parser.cpp index a76965508..070aea297 100644 --- a/tools/slang-cpp-extractor/parser.cpp +++ b/tools/slang-cpp-extractor/parser.cpp @@ -705,7 +705,8 @@ SlangResult Parser::_maybeParseTemplateArg(Index& ioTemplateDepth) m_reader.advanceToken(); return SLANG_OK; } - default: break; + default: + break; } return SLANG_FAIL; } @@ -796,7 +797,8 @@ static bool _canRepeatTokenType(TokenType type) { return false; } - default: break; + default: + break; } return true; } @@ -1259,10 +1261,14 @@ static TokenType _getBalancedClose(TokenType tokenType) SLANG_ASSERT(_isBalancedOpen(tokenType)); switch (tokenType) { - case TokenType::LBrace: return TokenType::RBrace; - case TokenType::LParent: return TokenType::RParent; - case TokenType::LBracket: return TokenType::RBracket; - default: return TokenType::Unknown; + case TokenType::LBrace: + return TokenType::RBrace; + case TokenType::LParent: + return TokenType::RParent; + case TokenType::LBracket: + return TokenType::RBracket; + default: + return TokenType::Unknown; } } @@ -1360,7 +1366,8 @@ SlangResult Parser::_consumeBalancedParens() // If we hit the end of the file, then not balanced return SLANG_FAIL; } - default: break; + default: + break; } m_reader.advanceToken(); @@ -1445,7 +1452,8 @@ SlangResult Parser::_parseExpression(List<Token>& outExprTokens) break; } - default: break; + default: + break; } outExprTokens.add(m_reader.advanceToken()); @@ -1841,12 +1849,18 @@ SlangResult Parser::_maybeParseContained(Node** outNode) { switch (style) { - case IdentifierStyle::Class: return Node::Kind::ClassType; - case IdentifierStyle::Struct: return Node::Kind::StructType; - case IdentifierStyle::Namespace: return Node::Kind::Namespace; - case IdentifierStyle::Enum: return Node::Kind::Enum; - case IdentifierStyle::TypeDef: return Node::Kind::TypeDef; - default: return Node::Kind::Invalid; + case IdentifierStyle::Class: + return Node::Kind::ClassType; + case IdentifierStyle::Struct: + return Node::Kind::StructType; + case IdentifierStyle::Namespace: + return Node::Kind::Namespace; + case IdentifierStyle::Enum: + return Node::Kind::Enum; + case IdentifierStyle::TypeDef: + return Node::Kind::TypeDef; + default: + return Node::Kind::Invalid; } } |
