diff options
author | Martin Probst <martin@probst.io> | 2016-11-10 16:21:02 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2016-11-10 16:21:02 +0000 |
commit | 3dbbefae36a866c17c1994403c711e4a63fe8047 (patch) | |
tree | 68b8befc427d1f50cd28bb19cea4411d3f89fd61 /clang/lib/Format | |
parent | 72fd75a0d1704272ac815b88b92557a77c2bf666 (diff) | |
download | bcm5719-llvm-3dbbefae36a866c17c1994403c711e4a63fe8047.tar.gz bcm5719-llvm-3dbbefae36a866c17c1994403c711e4a63fe8047.zip |
clang-format: [JS] do not break after declare namespace.
Summary:
See TypeScript grammar for tokens following 'declare':
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#A.10
Additional minor change:
clang-format: [JS] Prevent ASI before const.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D26274
llvm-svn: 286468
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index f38cfa999e2..52278d151e7 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -669,14 +669,14 @@ static bool mustBeJSIdent(const AdditionalKeywords &Keywords, // FIXME: This returns true for C/C++ keywords like 'struct'. return FormatTok->is(tok::identifier) && (FormatTok->Tok.getIdentifierInfo() == nullptr || - !FormatTok->isOneOf(Keywords.kw_in, Keywords.kw_of, Keywords.kw_as, - Keywords.kw_async, Keywords.kw_await, - Keywords.kw_yield, Keywords.kw_finally, - Keywords.kw_function, Keywords.kw_import, - Keywords.kw_is, Keywords.kw_let, Keywords.kw_var, - Keywords.kw_abstract, Keywords.kw_extends, - Keywords.kw_implements, Keywords.kw_instanceof, - Keywords.kw_interface, Keywords.kw_throws)); + !FormatTok->isOneOf( + Keywords.kw_in, Keywords.kw_of, Keywords.kw_as, Keywords.kw_async, + Keywords.kw_await, Keywords.kw_yield, Keywords.kw_finally, + Keywords.kw_function, Keywords.kw_import, Keywords.kw_is, + Keywords.kw_let, Keywords.kw_var, tok::kw_const, + Keywords.kw_abstract, Keywords.kw_extends, Keywords.kw_implements, + Keywords.kw_instanceof, Keywords.kw_interface, + Keywords.kw_throws)); } static bool mustBeJSIdentOrValue(const AdditionalKeywords &Keywords, |