[PATCH] clang-format: AnnotatedLine.StartsWith.

Martin Probst martinprobst at google.com
Tue Jun 16 15:08:03 PDT 2015


Hi djasper,

This supports checking for an arbitrary line
prefix, which is useful for e.g. JavaScript
`export class` vs `class`.

clang-format: [JS] Consistently format top level enums.

Object literal style enums are forced onto multiple lines for JS enums.
This change produces the same formatting for enums using the actual
TypeScript enum syntax:

    enum Color {
      Blue,
      Red,
      Tuna
    }

clang-format: use clang-format on clang-format.

clang-format: [JS] put enums on separate lines.

This change identifies enums in JS as complete declarations so that
trailing statements are formatted on a separate line.

    enum Color { Blue, Green }
    var x;

http://reviews.llvm.org/D10485

Files:
  lib/Format/TokenAnnotator.cpp
  lib/Format/TokenAnnotator.h
  lib/Format/UnwrappedLineParser.cpp
  unittests/Format/FormatTestJS.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10485.27784.patch
Type: text/x-patch
Size: 12575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150616/cc733ef0/attachment.bin>


More information about the cfe-commits mailing list