diff options
Diffstat (limited to 'clang/lib/Format/FormatTokenLexer.cpp')
| -rw-r--r-- | clang/lib/Format/FormatTokenLexer.cpp | 13 | 
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/Format/FormatTokenLexer.cpp b/clang/lib/Format/FormatTokenLexer.cpp index ab32938..a9ea5ec 100644 --- a/clang/lib/Format/FormatTokenLexer.cpp +++ b/clang/lib/Format/FormatTokenLexer.cpp @@ -318,14 +318,21 @@ void FormatTokenLexer::tryMergePreviousTokens() {                             {tok::equal, tok::greater},                             {tok::star, tok::greater},                             {tok::pipeequal, tok::greater}, -                           {tok::pipe, tok::arrow}, -                           {tok::hash, tok::minus, tok::hash}, -                           {tok::hash, tok::equal, tok::hash}}, +                           {tok::pipe, tok::arrow}},                            TT_BinaryOperator) ||          Tokens.back()->is(tok::arrow)) {        Tokens.back()->ForcedPrecedence = prec::Comma;        return;      } +    if (Tokens.size() >= 3 && +        Tokens[Tokens.size() - 3]->is(Keywords.kw_verilogHash) && +        Tokens[Tokens.size() - 2]->isOneOf(tok::minus, tok::equal) && +        Tokens[Tokens.size() - 1]->is(Keywords.kw_verilogHash) && +        tryMergeTokens(3, TT_BinaryOperator)) { +      Tokens.back()->setFinalizedType(TT_BinaryOperator); +      Tokens.back()->ForcedPrecedence = prec::Comma; +      return; +    }    } else if (Style.isTableGen()) {      // TableGen's Multi line string starts with [{      if (tryMergeTokens({tok::l_square, tok::l_brace},  | 
