Fix regression in string literal alignment.

Now correctly indents (again):
a = a + "a"
        "a"
        "a";

llvm-svn: 175630
This commit is contained in:
Manuel Klimek 2013-02-20 15:32:58 +00:00
parent 56821acc79
commit 0c91571d33
2 changed files with 4 additions and 1 deletions

View File

@ -692,7 +692,7 @@ private:
State.Stack.pop_back();
}
if (Current.is(tok::string_literal) && State.StartOfStringLiteral == 0) {
if (Current.is(tok::string_literal)) {
State.StartOfStringLiteral = State.Column;
} else if (Current.isNot(tok::comment)) {
State.StartOfStringLiteral = 0;

View File

@ -1452,6 +1452,9 @@ TEST_F(FormatTest, AlignsStringLiterals) {
"\"aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa "
"aaaaaaaaaaaaaaaaaaaaa\" "
"\"aaaaaaaaaaaaaaaa\";"));
verifyFormat("a = a + \"a\"\n"
" \"a\"\n"
" \"a\";");
}
TEST_F(FormatTest, AlignsPipes) {