clang-format: [JS] Support "export enum" declarations.

llvm-svn: 239595
This commit is contained in:
Daniel Jasper 2015-06-12 05:08:18 +00:00
parent 4c0bf7034c
commit 216c9cdb1d
2 changed files with 7 additions and 1 deletions

View File

@ -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)) {

View File

@ -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) {