]> granicus.if.org Git - clang/commit
Fixes parsing of hash tokens in the middle of a line.
authorManuel Klimek <klimek@google.com>
Sat, 5 Jan 2013 22:56:06 +0000 (22:56 +0000)
committerManuel Klimek <klimek@google.com>
Sat, 5 Jan 2013 22:56:06 +0000 (22:56 +0000)
commitf6fd00b12ae7d89436d32851c9bcc8dd3d046ad3
treec8d17d46d1f754bf515acb33f861ee31fd044b56
parentc37b4d60f926bf440dfcc312bd6482fed3176e33
Fixes parsing of hash tokens in the middle of a line.

To parse # correctly, we need to know whether it is the first token in a
line - we can deduct this either from the whitespace or seeing that the
token is the first in the file - we already calculate this information.
This patch moves the identification of the first token into the
getNextToken method and stores it inside the FormatToken, so the
UnwrappedLineParser can stay independent of the SourceManager.

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