Skips until the colon at the end of the case label, the argument must point to the "case" token. In case of success returns the colon token. In case of failure returns the token that caused the error.
| 4053 | // In case of success returns the colon token. |
| 4054 | // In case of failure returns the token that caused the error. |
| 4055 | static Token *skipCaseLabel(Token *tok) |
| 4056 | { |
| 4057 | assert(tok->str() == "case"); |
| 4058 | while (nullptr != (tok = tok->next())) { |
| 4059 | if (Token::Match(tok, "(|[")) |
| 4060 | tok = tok->link(); |
| 4061 | else if (tok->str() == "?") { |
| 4062 | Token * tok1 = skipTernaryOp(tok); |
| 4063 | if (!tok1) |
| 4064 | return tok; |
| 4065 | tok = tok1; |
| 4066 | } |
| 4067 | if (Token::Match(tok, "[:{};]")) |
| 4068 | return tok; |
| 4069 | } |
| 4070 | return nullptr; |
| 4071 | } |
| 4072 | |
| 4073 | const Token * Tokenizer::startOfExecutableScope(const Token * tok) |
| 4074 | { |
no test coverage detected