Skip to content

Commit

Permalink
clang-format: [JS] do not break after declare namespace.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mprobst committed Nov 10, 2016
1 parent 72fd75a commit 3dbbefa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions clang/lib/Format/UnwrappedLineParser.cpp
Expand Up @@ -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,
Expand Down

0 comments on commit 3dbbefa

Please sign in to comment.