diff options
author | Anteru <bitbucket@ca.sh13.net> | 2019-04-30 15:52:31 +0000 |
---|---|---|
committer | Anteru <bitbucket@ca.sh13.net> | 2019-04-30 15:52:31 +0000 |
commit | 28a21bdafa1b73d5515de18bd263797af61c2471 (patch) | |
tree | 3436c730359d89153f04ef572368abfcde1d3fcb /pygments/lexers/c_cpp.py | |
parent | e3872ea8f65ac2c3c40046a7a3acf4f0541f0e56 (diff) | |
parent | 601e6e86e45f31e23a7b29e1265d68aeba5e1366 (diff) | |
download | pygments-28a21bdafa1b73d5515de18bd263797af61c2471.tar.gz |
Merged in andrescarrasco/pygments-main/boa (pull request #756)
Add a lexer for the Boa Domain-Specific Langauge.
Diffstat (limited to 'pygments/lexers/c_cpp.py')
-rw-r--r-- | pygments/lexers/c_cpp.py | 8 |
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 |