summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-02 11:44:29 +0100
committerGeorg Brandl <georg@python.org>2016-02-02 11:44:29 +0100
commit6903aeae223fb170f50af21b732ff7f9a1459455 (patch)
treefd8b1cc5f9e5d409fc3532295aa65b9cbd72a7be
parent768b7d586e90f490899ad09a108e507c3c691708 (diff)
downloadpygments-6903aeae223fb170f50af21b732ff7f9a1459455.tar.gz
Closes #1103: support C++11 raw strings.
-rw-r--r--pygments/lexers/c_cpp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index 1f46d179..5c724d03 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -216,6 +216,8 @@ class CppLexer(CFamilyLexer):
'final'), suffix=r'\b'), Keyword),
(r'char(16_t|32_t)\b', Keyword.Type),
(r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
+ # C++11 raw strings
+ (r'R"\(', String, 'rawstring'),
inherit,
],
'root': [
@@ -232,6 +234,11 @@ class CppLexer(CFamilyLexer):
# template specification
(r'\s*(?=>)', Text, '#pop'),
],
+ 'rawstring': [
+ (r'\)"', String, '#pop'),
+ (r'[^)]+', String),
+ (r'\)', String),
+ ],
}
def analyse_text(text):