clang-format: [JS] Support "export enum" declarations.
llvm-svn: 239595
This commit is contained in:
parent
4c0bf7034c
commit
216c9cdb1d
|
@ -1725,7 +1725,8 @@ void UnwrappedLineParser::parseJavaScriptEs6ImportExport() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (FormatTok->isOneOf(tok::kw_const, tok::kw_class, Keywords.kw_var))
|
||||
if (FormatTok->isOneOf(tok::kw_const, tok::kw_class, tok::kw_enum,
|
||||
Keywords.kw_var))
|
||||
return; // Fall through to parsing the corresponding structure.
|
||||
|
||||
if (FormatTok->is(tok::l_brace)) {
|
||||
|
|
|
@ -747,6 +747,11 @@ TEST_F(FormatTestJS, Modules) {
|
|||
" a: 1,\n"
|
||||
" b: 2\n"
|
||||
"};");
|
||||
verifyFormat("export enum Foo {\n"
|
||||
" BAR,\n"
|
||||
" // adsdasd\n"
|
||||
" BAZ\n"
|
||||
"}");
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJS, TemplateStrings) {
|
||||
|
|
Loading…
Reference in New Issue