-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpp: Fully support C++11 raw strings. (#1897)
See https://en.cppreference.com/w/cpp/language/string_literal for the syntax. This requires a fix in highlight.js itself. mode.terminators joins each node's begin regexps with |. This breaks if one of the begin regexps has backreferences. Backreferences count capturing parenthesized groups, and adding new groups in front will change that count. Thus far, the only language that uses backreferences is Rust (also for raw strings), which happens to be the first in the list and avoids this bug. C++ cannot as easily avoid this because, even were raw strings the first option in STRINGS, STRINGS itself is included in other lists. Rather than carefully order things, rewrite the regularly expressions to fix the backreferences.
- Loading branch information
1 parent
5b1b86c
commit 8d95086
Showing
4 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters