clang-format: [JS] Support regex literals with trailing escaped slash.
Before: var regex = / a\//; int i; After: var regex = /a\//; int i; This required pushing the Lexer into its wrapper class and generating a new one in this specific case. Otherwise, the sequence get lexed as a //-comment. This is hacky, but I don't know a better way (short of supporting regex literals in the Lexer). Pushing the Lexer down seems to make all the call sites simpler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217444 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Format/Format.h 9 additions, 2 deletionsinclude/clang/Format/Format.h
- lib/Format/Format.cpp 58 additions, 26 deletionslib/Format/Format.cpp
- lib/Index/CommentToXML.cpp 1 addition, 6 deletionslib/Index/CommentToXML.cpp
- tools/clang-format/ClangFormat.cpp 1 addition, 4 deletionstools/clang-format/ClangFormat.cpp
- unittests/Format/FormatTestJS.cpp 2 additions, 0 deletionsunittests/Format/FormatTestJS.cpp
Loading
Please register or sign in to comment