summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-01-07 08:53:35 +0000
committerDaniel Jasper <djasper@google.com>2016-01-07 08:53:35 +0000
commitefc1a83a998556f1930c4072027ec83eb63465ce (patch)
tree0036af3629542bbb684a43f64f4bda3fc358eff5 /clang/lib/Format
parenta809acec40d974e165171a9f60a05060d84d18a4 (diff)
downloadbcm5719-llvm-efc1a83a998556f1930c4072027ec83eb63465ce.tar.gz
bcm5719-llvm-efc1a83a998556f1930c4072027ec83eb63465ce.zip
clang-format: [JS] Support more ES6 imports.
Before: import a, {X, Y} from 'some/module.js'; After: import a, {X, Y} from 'some/module.js'; llvm-svn: 257038
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 94b84988194..27e2f84d245 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -1796,14 +1796,13 @@ void UnwrappedLineParser::parseJavaScriptEs6ImportExport() {
Keywords.kw_let, Keywords.kw_var))
return; // Fall through to parsing the corresponding structure.
- if (FormatTok->is(tok::l_brace)) {
- FormatTok->BlockKind = BK_Block;
- parseBracedList();
- }
-
- while (!eof() && FormatTok->isNot(tok::semi) &&
- FormatTok->isNot(tok::l_brace)) {
- nextToken();
+ while (!eof() && FormatTok->isNot(tok::semi)) {
+ if (FormatTok->is(tok::l_brace)) {
+ FormatTok->BlockKind = BK_Block;
+ parseBracedList();
+ } else {
+ nextToken();
+ }
}
}
OpenPOWER on IntegriCloud