Skip to content
Snippets Groups Projects
Commit a055582e authored by Daniel Jasper's avatar Daniel Jasper
Browse files

clang-format: [JS] Handle string literals spanning character classes.

If a RegExp contains a character group with a quote (/["]/), the
trailing end of it is first tokenized as a string literal, which leads
to the merging code seeing an unbalanced bracket.

This change parses regex literals from the left hand side. That
simplifies the parsing code and also allows correctly handling escapes
and character classes, hopefully correctly parsing all regex literals.

Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D13765

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250648 91177308-0d34-0410-b5e6-96231b3b80d8
parent f112eacb
Branches
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment