diff options
author | Georg Brandl <georg@python.org> | 2014-11-09 12:48:11 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-11-09 12:48:11 +0100 |
commit | 4978e0fa9c0dc91ffeb4afd9ee0e97b1ff83d859 (patch) | |
tree | 28999a91b8aacb35b959b8b5405f4dba7b52e71a /pygments/lexers/c_cpp.py | |
parent | 85a486b6addfc4b7b0564d933ce26c91c14e06d1 (diff) | |
download | pygments-4978e0fa9c0dc91ffeb4afd9ee0e97b1ff83d859.tar.gz |
Closes #1057: adjust lexer analysis functions; remove too broad analysis for SystemVerilog and strengthen C.
Diffstat (limited to 'pygments/lexers/c_cpp.py')
-rw-r--r-- | pygments/lexers/c_cpp.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py index 2e12ec4b..128cc6ce 100644 --- a/pygments/lexers/c_cpp.py +++ b/pygments/lexers/c_cpp.py @@ -177,7 +177,9 @@ class CLexer(CFamilyLexer): priority = 0.1 def analyse_text(text): - if re.search('#include [<"]', text): + if re.search('^\s*#include [<"]', text, re.MULTILINE): + return 0.1 + if re.search('^\s*#ifdef ', text, re.MULTILINE): return 0.1 |