r257406 - clang-format: [JS] Teach clang-format about "export interface".
Daniel Jasper via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 11 14:57:40 PST 2016
Author: djasper
Date: Mon Jan 11 16:57:40 2016
New Revision: 257406
URL: http://llvm.org/viewvc/llvm-project?rev=257406&view=rev
Log:
clang-format: [JS] Teach clang-format about "export interface".
Modified:
cfe/trunk/lib/Format/UnwrappedLineParser.cpp
cfe/trunk/unittests/Format/FormatTestJS.cpp
Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.cpp?rev=257406&r1=257405&r2=257406&view=diff
==============================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp (original)
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp Mon Jan 11 16:57:40 2016
@@ -1810,7 +1810,8 @@ void UnwrappedLineParser::parseJavaScrip
}
if (FormatTok->isOneOf(tok::kw_const, tok::kw_class, tok::kw_enum,
- Keywords.kw_let, Keywords.kw_var))
+ Keywords.kw_interface, Keywords.kw_let,
+ Keywords.kw_var))
return; // Fall through to parsing the corresponding structure.
while (!eof() && FormatTok->isNot(tok::semi)) {
Modified: cfe/trunk/unittests/Format/FormatTestJS.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestJS.cpp?rev=257406&r1=257405&r2=257406&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTestJS.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTestJS.cpp Mon Jan 11 16:57:40 2016
@@ -900,6 +900,10 @@ TEST_F(FormatTestJS, Modules) {
"];");
verifyFormat("export default [];");
verifyFormat("export default () => {};");
+ verifyFormat("export interface Foo { foo: number; }\n"
+ "export class Bar {\n"
+ " blah(): string { return this.blah; };\n"
+ "}");
}
TEST_F(FormatTestJS, TemplateStrings) {
More information about the cfe-commits
mailing list