================
@@ -1232,13 +1234,15 @@ class AnnotatingParser {
return false;
updateParameterCount(&OpeningBrace, CurrentToken);
if (CurrentToken->isOneOf(tok::colon, tok::l_brace, tok::less)) {
+ assert(!Scopes.empty());
FormatToken *Previous = CurrentToken->getPreviousNonComment();
if (Previous->is(TT_JsTypeOptionalQuestion))
Previous = Previous->getPreviousNonComment();
if ((CurrentToken->is(tok::colon) && !Style.isTableGen() &&
(!Contexts.back().ColonIsDictLiteral || !IsCpp)) ||
Style.isProto()) {
OpeningBrace.setType(TT_DictLiteral);
+ Scopes.back() = getScopeType(OpeningBrace);
----------------
aaronsms wrote:
My rationale was that to correct the scope type whenever the OpeningBrace has
undergone any modifications. Are you suggesting something like this?
```cpp
while (CurrentToken) {
assert(!Scopes.empty());
Scopes.back() = getScopeType(OpeningBrace);
```
https://github.com/llvm/llvm-project/pull/194154
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits