djasper added inline comments.

================
Comment at: lib/Format/TokenAnnotator.cpp:760
@@ +759,3 @@
+      if (CurrentToken->is(tok::kw_export)) {
+        // Find the 'from' part of export {...} from '...';
+        // The difference here is that "export {...};" should not be treated as
----------------
Can you actually have:

  export {a as from};

?

================
Comment at: lib/Format/TokenAnnotator.cpp:763
@@ +762,3 @@
+        // an export.
+        while (CurrentToken) {
+          if (CurrentToken->is(tok::semi))
----------------
Not a big fan of the code duplication in this loop. How about doing:

  if (Style.Language == FormatStyle::LK_JavaScript &&
      ((Line.First->is(tok::kw_export) && CurrentToken->is(Keywords.kw_from)) ||
       isClosureImportStatement(*CurrentToken)))
    return LT_ImportStatement;

in the lower loop? The ImportStatement variable can likely go away then.


http://reviews.llvm.org/D17440



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to