This revision was automatically updated to reflect the committed changes.
Closed by commit rL279727: clang-format: [JS] nested and tagged template
strings. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D22431?vs=68853=69219#toc
Repository:
rL LLVM
mprobst added a comment.
No worries, thanks for the review.
https://reviews.llvm.org/D22431
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good. Sorry for the delay!
Comment at: lib/Format/FormatTokenLexer.h:68
@@ +67,3 @@
+ // embedding expressions nested in ${expr-here}. Template strings can be
+ //
mprobst updated this revision to Diff 68853.
mprobst added a comment.
- Fix escaping issue.
https://reviews.llvm.org/D22431
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index:
mprobst added inline comments.
Comment at: lib/Format/FormatTokenLexer.cpp:259
@@ -241,1 +258,3 @@
++Offset; // Skip the escaped character.
+if (Offset + 1 < Lex->getBuffer().end() && Offset[0] == '$' &&
+Offset[1] == '{') {
Question by @ygao
mprobst updated this revision to Diff 68851.
mprobst added a comment.
- Test escaped dollar sign.
https://reviews.llvm.org/D22431
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index:
mprobst marked 9 inline comments as done.
mprobst added a comment.
https://reviews.llvm.org/D22431
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst updated this revision to Diff 68687.
mprobst added a comment.
- Use a stack to parse nested template strings.
- move docs
- Fold GreaterStashed, LessStashed into TOKEN_STASHED lexer state.
https://reviews.llvm.org/D22431
Files:
lib/Format/FormatTokenLexer.cpp
djasper added inline comments.
Comment at: lib/Format/FormatTokenLexer.cpp:254
@@ +253,3 @@
+ for (; Offset != Lex->getBuffer().end(); ++Offset) {
+if (*Offset == '`') {
+ StateStack.pop();
I'd use Offset[0]
Comment at:
mprobst added a comment.
Friendly ping :-)
https://reviews.llvm.org/D22431
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst updated this revision to Diff 64803.
mprobst added a comment.
- Use a stack to parse nested template strings.
- move docs
https://reviews.llvm.org/D22431
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
lib/Format/TokenAnnotator.cpp
mprobst marked an inline comment as done.
Comment at: lib/Format/FormatTokenLexer.cpp:231
@@ -230,3 +230,3 @@
void FormatTokenLexer::tryParseTemplateString() {
FormatToken *BacktickToken = Tokens.back();
djasper wrote:
> I think, this could now use an
djasper added inline comments.
Comment at: lib/Format/FormatTokenLexer.cpp:231
@@ -230,3 +230,3 @@
void FormatTokenLexer::tryParseTemplateString() {
FormatToken *BacktickToken = Tokens.back();
I think, this could now use an elaborate comment on what it is
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1821
@@ -1819,1 +1820,3 @@
+(Right.is(TT_TemplateString) && Right.TokenText.startswith("}")))
+ return 100;
}
I've chosen 100 by fair dice roll. Please advise on how to pick
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
https://reviews.llvm.org/D22431
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
lib/Format/TokenAnnotator.cpp
15 matches
Mail list logo