From 29e0a9929747c869c3a049c87cb976122e9100dd Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Mon, 3 Jul 2017 15:31:28 +0000 Subject: [PATCH] Revert "clang-format: [JS] space between pseudo keywords and template literals." This reverts commit 71d3b5cd916106005ef23467e3f6c7fbca7bc499. llvm-svn: 307034 --- clang/lib/Format/TokenAnnotator.cpp | 6 +----- clang/unittests/Format/FormatTestJS.cpp | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 888b6b67458c..a7250cf16950 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -2319,11 +2319,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, if ((Left.is(TT_TemplateString) && Left.TokenText.endswith("${")) || (Right.is(TT_TemplateString) && Right.TokenText.startswith("}"))) return false; - // In tagged template literals ("html`bar baz`"), there is no space between - // the tag identifier and the template string. getIdentifierInfo makes sure - // that the identifier is not a pseudo keyword like `yield`, either. - if (Left.is(tok::identifier) && Left.Tok.getIdentifierInfo() == nullptr && - Right.is(TT_TemplateString)) + if (Left.is(tok::identifier) && Right.is(TT_TemplateString)) return false; if (Right.is(tok::star) && Left.isOneOf(Keywords.kw_function, Keywords.kw_yield)) diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index db23902ef3eb..e84f470687ec 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -1564,7 +1564,6 @@ TEST_F(FormatTestJS, TemplateStrings) { " aaaaa( //\n" " aaaaa)\n" " })`);"); - verifyFormat("yield `hello`;"); } TEST_F(FormatTestJS, TemplateStringMultiLineExpression) {