llvm-project/clang/lib/Format
Martin Probst 6181da4796 clang-format: [JS] nested and tagged template strings.
JavaScript template strings can be nested arbitrarily:

    foo = `text ${es.map(e => { return `<${e}>`; })} text`;

This change lexes nested template strings using a stack of lexer states to
correctly switch back to template string lexing on closing braces.

Also, reuse the same stack for the token-stashed logic.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D22431

llvm-svn: 279727
2016-08-25 10:13:21 +00:00
..
AffectedRangeManager.cpp Added Fixer implementation and fix() interface in clang-format for removing redundant code. 2016-04-25 15:09:22 +00:00
AffectedRangeManager.h removed redundant '#' 2016-04-28 07:52:06 +00:00
BreakableToken.cpp clang-format: clang-format (NFC) 2015-06-17 13:08:06 +00:00
BreakableToken.h Roll-back r250822. 2015-10-20 13:23:58 +00:00
CMakeLists.txt clang-format: [JS] sort ES6 imports. 2016-05-20 11:24:24 +00:00
ContinuationIndenter.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ContinuationIndenter.h Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551. 2016-04-28 07:52:03 +00:00
Encoding.h Add missing include for StringRef (NFC) 2016-04-18 09:08:59 +00:00
Format.cpp Make clang-format remove duplicate headers when sorting #includes. 2016-08-10 09:32:23 +00:00
FormatToken.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
FormatToken.h clang-format: [JS] recognize more type locations. 2016-06-23 19:52:32 +00:00
FormatTokenLexer.cpp clang-format: [JS] nested and tagged template strings. 2016-08-25 10:13:21 +00:00
FormatTokenLexer.h clang-format: [JS] nested and tagged template strings. 2016-08-25 10:13:21 +00:00
SortJavaScriptImports.cpp Implement tooling::Replacements as a class. 2016-08-01 10:16:37 +00:00
SortJavaScriptImports.h clang-format: [JS] sort ES6 imports. 2016-05-20 11:24:24 +00:00
TokenAnalyzer.cpp Implement tooling::Replacements as a class. 2016-08-01 10:16:37 +00:00
TokenAnalyzer.h clang-format: [JS] sort ES6 imports. 2016-05-20 11:24:24 +00:00
TokenAnnotator.cpp clang-format: [JS] nested and tagged template strings. 2016-08-25 10:13:21 +00:00
TokenAnnotator.h [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
UnwrappedLineFormatter.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
UnwrappedLineFormatter.h [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
UnwrappedLineParser.cpp clang-format: [JS] handle object literals with casts. 2016-08-19 14:35:01 +00:00
UnwrappedLineParser.h clang-format: [JS] Handle certain cases of ASI. 2016-03-14 19:21:36 +00:00
WhitespaceManager.cpp Implement tooling::Replacements as a class. 2016-08-01 10:16:37 +00:00
WhitespaceManager.h Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551. 2016-04-28 07:52:03 +00:00