Formatter: Detect ObjC message expressions after 'in' in loop
authorNico Weber <nicolasweber@gmx.de>
Mon, 11 Feb 2013 15:32:15 +0000 (15:32 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 11 Feb 2013 15:32:15 +0000 (15:32 +0000)
commit29f9dea1ab821e9b0c7cada17802e6b3fd5a7c93
treeef5a4854d7648961b19ddc531febb22253a8e307
parent154faa6deda4d6b14f074f43b74519152d922784
Formatter: Detect ObjC message expressions after 'in' in loop

Before:
  for (id foo in[self getStuffFor : bla]) {
  }

Now:
  for (id foo in [self getStuffFor:bla]) {
  }

"in" is treated as loop keyword if the line starts with "for", and as a
regular identifier else. To check for "in", its IdentifierInfo is handed
through a few layers.

llvm-svn: 174889
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/TokenAnnotator.h
clang/unittests/Format/FormatTest.cpp