]> granicus.if.org Git - clang/commit
clang-format: [JS] Handle certain cases of ASI.
authorDaniel Jasper <djasper@google.com>
Mon, 14 Mar 2016 19:21:36 +0000 (19:21 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 14 Mar 2016 19:21:36 +0000 (19:21 +0000)
commite14f44c2b5b57c69bbd0f3d6be438d509dc0ae45
treef7d7d41439850f325eb6acedbe92e5ab8c2b4dab
parenta237fa06fdfa4db7170f4858bd956583cde9b888
clang-format: [JS] Handle certain cases of ASI.

Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations prevents breaking code during development, which greatly
improves usability.

JS code should still use semicolons, and ASI code should be flagged by
a compiler or linter.

Patch by Martin Probst. Thank you.

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