]> granicus.if.org Git - clang/commit
Fix layouting of tokens with a leading escaped newline.
authorManuel Klimek <klimek@google.com>
Mon, 7 Jan 2013 07:56:50 +0000 (07:56 +0000)
committerManuel Klimek <klimek@google.com>
Mon, 7 Jan 2013 07:56:50 +0000 (07:56 +0000)
commit9541938d4e3b9cbafdf0e1a28900c535b82767a4
tree637902cf6e8a07d904303e9835aff56d8e3d3a9e
parent46a46a20a3ec397192550915964cb227e87b79b2
Fix layouting of tokens with a leading escaped newline.

If a token follows directly on an escaped newline, the escaped newline
is stored with the token. Since we re-layout escaped newlines, we need
to treat them just like normal whitespace - thus, we need to increase
the whitespace-length of the token, while decreasing the token length
(otherwise the token length contains the length of the escaped newline
and we double-count it while indenting).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171706 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
lib/Format/UnwrappedLineParser.h
unittests/Format/FormatTest.cpp