[PATCH] clang-format recognizes alternative binary operator keywords

Bobby Moretti bobmoretti at gmail.com
Tue May 6 20:44:21 PDT 2014


clang-format does not lex the ISO 646 alternative operator keywords as operators; rather, it interprets them as normal identifiers.

This would result in code such as `(a) and (b)` getting reformatted as `(a)and(b)`.

As a result of some discussion on cfe-dev, this patch changes the lexer option used by clang-format to interpret these keywords as operators and not identifiers.

http://reviews.llvm.org/D3634

Files:
  include/clang/Format/Format.h
  lib/Format/Format.cpp
  tools/clang-format/ClangFormat.cpp
  unittests/Format/FormatTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3634.9143.patch
Type: text/x-patch
Size: 7793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140507/fdfa0ba8/attachment.bin>


More information about the cfe-commits mailing list