summaryrefslogtreecommitdiff
path: root/pygments/lexers/c_cpp.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-11-09 12:48:11 +0100
committerGeorg Brandl <georg@python.org>2014-11-09 12:48:11 +0100
commit4978e0fa9c0dc91ffeb4afd9ee0e97b1ff83d859 (patch)
tree28999a91b8aacb35b959b8b5405f4dba7b52e71a /pygments/lexers/c_cpp.py
parent85a486b6addfc4b7b0564d933ce26c91c14e06d1 (diff)
downloadpygments-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.py4
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