summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-01-12 06:24:38 +0000
committerDaniel Jasper <djasper@google.com>2016-01-12 06:24:38 +0000
commit8620d4c55b7db88f534e4369a62782a5070d77e9 (patch)
tree771b9b27f2706e8e92929e596b9eeb2ab7a8812d /clang/lib/Format
parentdb147eb5acd92bc2dfdf7c157c1ce501fb24d7d8 (diff)
downloadbcm5719-llvm-8620d4c55b7db88f534e4369a62782a5070d77e9.tar.gz
bcm5719-llvm-8620d4c55b7db88f534e4369a62782a5070d77e9.zip
clang-format: [JS] Support exporting abstract classes.
Before: export abstract class X {y: number;} (and all sorts of other havoc in more complicated cases). After: export abstract class X { y: number; } llvm-svn: 257451
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index d35d8a6053d..7b8f6e65241 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -1809,6 +1809,10 @@ void UnwrappedLineParser::parseJavaScriptEs6ImportExport() {
return;
}
+ // Consume the "abstract" in "export abstract class".
+ if (FormatTok->is(Keywords.kw_abstract))
+ nextToken();
+
if (FormatTok->isOneOf(tok::kw_const, tok::kw_class, tok::kw_enum,
Keywords.kw_interface, Keywords.kw_let,
Keywords.kw_var))
OpenPOWER on IntegriCloud