summaryrefslogtreecommitdiff
path: root/pygments/lexers/c_cpp.py
diff options
context:
space:
mode:
authorMatth?us G. Chajdas <dev@anteru.net>2018-12-19 19:24:43 +0100
committerMatth?us G. Chajdas <dev@anteru.net>2018-12-19 19:24:43 +0100
commit19adba94a0334428cc043e5c234f2f65bbb667b4 (patch)
tree96c21882a616a1aa80e3dedc7ddd8baf8afe6924 /pygments/lexers/c_cpp.py
parent374c774f204b1999f164df485adde6d33aeed19c (diff)
parent90f099f0aed96438ee293413caffd26f1758e380 (diff)
downloadpygments-19adba94a0334428cc043e5c234f2f65bbb667b4.tar.gz
Merge fix for recently introduced failures.
Diffstat (limited to 'pygments/lexers/c_cpp.py')
-rw-r--r--pygments/lexers/c_cpp.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index 691f5ab4..38f425db 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -36,7 +36,7 @@ class CFamilyLexer(RegexLexer):
tokens = {
'whitespace': [
# preprocessor directives: without whitespace
- ('^#if\s+0', Comment.Preproc, 'if0'),
+ (r'^#if\s+0', Comment.Preproc, 'if0'),
('^#', Comment.Preproc, 'macro'),
# or with whitespace
('^(' + _ws1 + r')(#if\s+0)',
@@ -84,7 +84,7 @@ class CFamilyLexer(RegexLexer):
prefix=r'__', suffix=r'\b'), Keyword.Reserved),
(r'(true|false|NULL)\b', Name.Builtin),
(r'([a-zA-Z_]\w*)(\s*)(:)(?!:)', bygroups(Name.Label, Text, Punctuation)),
- ('[a-zA-Z_]\w*', Name),
+ (r'[a-zA-Z_]\w*', Name),
],
'root': [
include('whitespace'),
@@ -190,9 +190,9 @@ class CLexer(CFamilyLexer):
priority = 0.1
def analyse_text(text):
- if re.search('^\s*#include [<"]', text, re.MULTILINE):
+ if re.search(r'^\s*#include [<"]', text, re.MULTILINE):
return 0.1
- if re.search('^\s*#ifn?def ', text, re.MULTILINE):
+ if re.search(r'^\s*#ifn?def ', text, re.MULTILINE):
return 0.1