/// and other tokens that we treat like binary operators.
int getCurrentPrecedence() {
if (Current) {
+ const FormatToken *NextNonComment = Current->getNextNonComment();
if (Current->Type == TT_ConditionalExpr)
return prec::Conditional;
+ else if (NextNonComment && NextNonComment->is(tok::colon) &&
+ NextNonComment->Type == TT_DictLiteral)
+ return prec::Comma;
else if (Current->is(tok::semi) || Current->Type == TT_InlineASMColon ||
Current->Type == TT_SelectorName ||
- (Current->is(tok::comment) && Current->getNextNonComment() &&
- Current->getNextNonComment()->Type == TT_SelectorName))
+ (Current->is(tok::comment) && NextNonComment &&
+ NextNonComment->Type == TT_SelectorName))
return 0;
else if (Current->Type == TT_RangeBasedForLoopColon)
return prec::Comma;