[PATCH] D20632: clang-format: [JS] Support shebang lines on the very first line.

Alex Eagle via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 19:07:18 PDT 2016


alexeagle added a subscriber: alexeagle.

================
Comment at: lib/Format/FormatTokenLexer.cpp:23
@@ -22,1 +22,3 @@
 
+#include "llvm/Support/Debug.h"
+
----------------
revert this file

================
Comment at: lib/Format/TokenAnnotator.cpp:698
@@ +697,3 @@
+
+    if (Style.Language == FormatStyle::LK_JavaScript) {
+      // JavaScript files can contain shebang lines of the form:
----------------
should we still restrict it to be on the first line?

I suppose if you start some other line with #, that's not valid JS or TS so it doesn't matter what clang-format does to it? Maybe it's fine like this.


http://reviews.llvm.org/D20632





More information about the cfe-commits mailing list