diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-11 09:14:50 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-11 09:14:50 +0000 |
commit | ec05fc7b16473e5bee82bc8f18bcd97fe68df101 (patch) | |
tree | f651d7713d3b3db44ef299dd9e28eba99b4700d2 | |
parent | 0fd96dddf503d31ed9773f380f3e9caab82eb9e7 (diff) | |
download | bcm5719-llvm-ec05fc7b16473e5bee82bc8f18bcd97fe68df101.tar.gz bcm5719-llvm-ec05fc7b16473e5bee82bc8f18bcd97fe68df101.zip |
clang-format: [JS] Clean up export declaration parsing.
NFC intended.
llvm-svn: 236982
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 437d688dc57..a2afcc0fd5b 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -1666,10 +1666,12 @@ void UnwrappedLineParser::parseJavaScriptEs6ImportExport() { assert(FormatTok->isOneOf(Keywords.kw_import, tok::kw_export)); nextToken(); - // Consume "function" and "default function", so that these get parsed as - // free-standing JS functions, i.e. do not require a trailing semicolon. + // Consume the "default" in "export default class/function". if (FormatTok->is(tok::kw_default)) nextToken(); + + // Consume "function" and "default function", so that these get parsed as + // free-standing JS functions, i.e. do not require a trailing semicolon. if (FormatTok->is(Keywords.kw_function)) { nextToken(); return; @@ -1678,11 +1680,6 @@ void UnwrappedLineParser::parseJavaScriptEs6ImportExport() { if (FormatTok->isOneOf(tok::kw_const, tok::kw_class, Keywords.kw_var)) return; // Fall through to parsing the corresponding structure. - if (FormatTok->is(tok::kw_default)) { - nextToken(); // export default ..., fall through after eating 'default'. - return; - } - if (FormatTok->is(tok::l_brace)) { FormatTok->BlockKind = BK_Block; parseBracedList(); |