mprobst created this revision. mprobst added a reviewer: krasimir. mprobst requested review of this revision. Herald added a project: clang.
ES2021 allows numeric literals using `_` as a separator. This already works, but had no test. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D115147 Files: clang/unittests/Format/FormatTestJS.cpp Index: clang/unittests/Format/FormatTestJS.cpp =================================================================== --- clang/unittests/Format/FormatTestJS.cpp +++ clang/unittests/Format/FormatTestJS.cpp @@ -2692,5 +2692,9 @@ "}\n"); } +TEST_F(FormatTestJS, NumericSeparators) { + verifyFormat("x = 1_000_000 + 12;", "x = 1_000_000 + 12;"); +} + } // namespace format } // end namespace clang
Index: clang/unittests/Format/FormatTestJS.cpp =================================================================== --- clang/unittests/Format/FormatTestJS.cpp +++ clang/unittests/Format/FormatTestJS.cpp @@ -2692,5 +2692,9 @@ "}\n"); } +TEST_F(FormatTestJS, NumericSeparators) { + verifyFormat("x = 1_000_000 + 12;", "x = 1_000_000 + 12;"); +} + } // namespace format } // end namespace clang
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits