Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.
Details
Diff Detail
Event Timeline
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2127 | From a quick look at our codebase, I think you need to also rule out the following for Right.Next:
|
- invert check to whitelist known tokens that can precede a non-null assertion.
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2127 | Actually, I think inverting the condition and "whitelisting" preceding tokens makes more sense and is probably a lot more robust. PTAL, now checking left for identifier, r_paren, r_square, literal. |
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2128 | Can you add a test for each of these? Also, how can a literal be null? |
- more tests
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2128 | Tests added. A literal cannot really be null, but the operator is allowed after any kind of expression, and it's straight forward to test for it here. |
From a quick look at our codebase, I think you need to also rule out the following for Right.Next: