[PATCH] D21204: clang-format: [JS] post-fix non-null assertion operator.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 9 21:53:11 PDT 2016


djasper added inline comments.

================
Comment at: lib/Format/TokenAnnotator.cpp:2127
@@ +2126,3 @@
+    // Postfix non-null assertion operator, as in `foo!.bar()`.
+    if (Right.is(tok::exclaim) && Right.Next &&
+        Right.Next->isNot(tok::identifier) && !Right.Next->Tok.isLiteral())
----------------
>From a quick look at our codebase, I think you need to also rule out the following for Right.Next:

  - (, [, {
  - !  ('!!' seems to be a thing)
  - -, +, ~ (don't know exactly what this does to a JS boolean value)
  - %, $ (not entirely sure whether these become part of the identifier)




http://reviews.llvm.org/D21204





More information about the cfe-commits mailing list