diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-26 07:18:56 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-26 07:18:56 +0000 |
commit | 0805199185ef27e3ebd87acb95bbf5a794ee7efe (patch) | |
tree | d0ce3d667f7f02ddb94c63f96506333022e9258d /clang/lib/Format | |
parent | 1a028227041034ea7c8e8f1826a97d18dab32e89 (diff) | |
download | bcm5719-llvm-0805199185ef27e3ebd87acb95bbf5a794ee7efe.tar.gz bcm5719-llvm-0805199185ef27e3ebd87acb95bbf5a794ee7efe.zip |
clang-format: [JS] Support ES6 spread operator.
Specifically, don't add a space before it.
Before:
someFunction(... a);
var x = [1, 2, ... a];
After:
someFunction(...a);
var x = [1, 2, ...a];
llvm-svn: 238183
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index c2e29080dcf..8229471071c 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1874,6 +1874,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, if ((Left.is(tok::l_brace) || Right.is(tok::r_brace)) && Line.First->isOneOf(Keywords.kw_import, tok::kw_export)) return false; + if (Left.is(tok::ellipsis)) + return false; if (Left.is(TT_TemplateCloser) && !Right.isOneOf(tok::equal, tok::l_brace, tok::comma, tok::l_square, Keywords.kw_implements, Keywords.kw_extends)) |