Handle zero-width and double-width characters in string literals and comments.
authorAlexander Kornienko <alexfh@google.com>
Thu, 5 Sep 2013 14:08:34 +0000 (14:08 +0000)
committerAlexander Kornienko <alexfh@google.com>
Thu, 5 Sep 2013 14:08:34 +0000 (14:08 +0000)
commitebb43caae250d5d5f3f853392460456a0a58abb1
tree29874d67e67d34dd9d144d1ad8a29c2de1906a8b
parent15832288f4feac7abfbccdbb567a7cd456913ae5
Handle zero-width and double-width characters in string literals and comments.

Summary:
Count column width instead of the number of code points. This also
includes correct handling of tabs inside string literals and comments (with an
exception of multiline string literals/comments, where tabs are present before
the first escaped newline).

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1601

llvm-svn: 190052
clang/include/clang/Format/Format.h
clang/lib/Format/BreakableToken.cpp
clang/lib/Format/BreakableToken.h
clang/lib/Format/ContinuationIndenter.cpp
clang/lib/Format/Encoding.h
clang/lib/Format/Format.cpp
clang/lib/Format/FormatToken.h
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp