This revision was automatically updated to reflect the committed changes.
Closed by commit rL310851: clang-format: [JS] do not insert whitespace in call
positions. (authored by mprobst).
Repository:
rL LLVM
https://reviews.llvm.org/D36142
Files:
cfe/trunk/lib/Format/TokenAnnotator.cpp
cfe
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
https://reviews.llvm.org/D36142
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listi
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2355
+(Left.Tok.getIdentifierInfo() ||
+ Left.isOneOf(tok::kw_switch, tok::kw_case, tok::kw_delete)))
+ return false;
djasper wrote:
> Why is instanceof not required in
mprobst updated this revision to Diff 110959.
mprobst marked 2 inline comments as done.
mprobst added a comment.
- clean up implementation, just use getIdentifierInfo
- clean up tests, remove illegal syntax, add more tests
https://reviews.llvm.org/D36142
Files:
lib/Format/TokenAnnotator.cpp
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2355
+(Left.Tok.getIdentifierInfo() ||
+ Left.isOneOf(tok::kw_switch, tok::kw_case, tok::kw_delete)))
+ return false;
Why is instanceof not required in this list?
mprobst updated this revision to Diff 109089.
mprobst added a comment.
- support switch, case, delete.
https://reviews.llvm.org/D36142
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
==
mprobst created this revision.
Herald added a subscriber: klimek.
In JavaScript, may keywords can be used in method names and thus call sites:
foo.delete();
foo.instanceof();
clang-format would previously insert whitespace after the `instanceof`. This
change generically skips inserting white