MyDeveloperDay marked 2 inline comments as done.
MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1019
+        FormatToken *NextNext = Tokens->getNextToken();
+        Tokens->setPosition(StoredPosition);
+        if (NextNext && NextNext->is(tok::equal))
----------------
mprobst wrote:
> parsePPEndIf uses a different method to peek - any opinion on why you're 
> doing it differently here?
I'm not entirely convinced parsePPEndIf IS looking at the next token

shouldn't

```
unsigned TokenPosition = Tokens->getPosition();
FormatToken *PeekNext = AllTokens[TokenPosition];
```
be

```
unsigned TokenPosition = Tokens->getPosition();
FormatToken *PeekNext = AllTokens[TokenPosition+1];
```

I followed the pattern in `parseStructuralElement()` but I think I should avoid 
that repitition by adding a function

also from elsewhere we see this:

`FormatToken *Previous = AllTokens[Tokens->getPosition() - 1];`

and so by definition, I would think it was.

`FormatToken *CurrentToken= AllTokens[Tokens->getPosition()];`
`FormatToken *NextToken= AllTokens[Tokens->getPosition() + 1];`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105087/new/

https://reviews.llvm.org/D105087

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to