ThirdParty/Pygments/pygments/lexers/c_cpp.py

changeset 5072
aab59042fefb
parent 4697
c2e9bf425554
child 5713
6762afd9f963
diff -r 4e4651e88674 -r aab59042fefb ThirdParty/Pygments/pygments/lexers/c_cpp.py
--- a/ThirdParty/Pygments/pygments/lexers/c_cpp.py	Wed Jul 27 18:10:08 2016 +0200
+++ b/ThirdParty/Pygments/pygments/lexers/c_cpp.py	Fri Jul 29 19:50:40 2016 +0200
@@ -216,6 +216,8 @@
                 '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,10 +234,15 @@
             # template specification
             (r'\s*(?=>)', Text, '#pop'),
         ],
+        'rawstring': [
+            (r'\)"', String, '#pop'),
+            (r'[^)]+', String),
+            (r'\)', String),
+        ],
     }
 
     def analyse_text(text):
-        if re.search('#include <[a-z]+>', text):
+        if re.search('#include <[a-z_]+>', text):
             return 0.2
         if re.search('using namespace ', text):
             return 0.4

eric ide

mercurial