diff options
author | Daniel Jasper <djasper@google.com> | 2016-03-14 19:21:36 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-03-14 19:21:36 +0000 |
commit | e14f44c2b5b57c69bbd0f3d6be438d509dc0ae45 (patch) | |
tree | f7d7d41439850f325eb6acedbe92e5ab8c2b4dab /lib/Format/UnwrappedLineParser.h | |
parent | a237fa06fdfa4db7170f4858bd956583cde9b888 (diff) |
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
Diffstat (limited to 'lib/Format/UnwrappedLineParser.h')
-rw-r--r-- | lib/Format/UnwrappedLineParser.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h index 6d40ab4f31..9c78d33632 100644 --- a/lib/Format/UnwrappedLineParser.h +++ b/lib/Format/UnwrappedLineParser.h @@ -81,6 +81,7 @@ private: void parsePPElse(); void parsePPEndIf(); void parsePPUnknown(); + void readTokenWithJavaScriptASI(); void parseStructuralElement(); bool tryToParseBracedList(); bool parseBracedList(bool ContinueOnSemicolons = false); |