summaryrefslogtreecommitdiff
path: root/pygments/lexers/c_cpp.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2015-10-13 11:32:25 -0700
committerTim Hatch <tim@timhatch.com>2015-10-13 11:32:25 -0700
commit27e304015dc3882ddb59122e168765775fb0e014 (patch)
tree0e34b7e356cc461ad1c8686b80224701907e6121 /pygments/lexers/c_cpp.py
parent9387070c755ac993b8ef5ff807c91d91461bcae8 (diff)
parent30ed00b906b25fb04374bc507ba3ca0d627fa753 (diff)
downloadpygments-27e304015dc3882ddb59122e168765775fb0e014.tar.gz
Merged in jakepetroules/pygments-main/qbs (pull request #474)
Add support for highlighting Qbs files.
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 bbac406e..35ea517f 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -28,8 +28,10 @@ class CFamilyLexer(RegexLexer):
#: optional Comment or Whitespace
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+ # The trailing ?, rather than *, avoids a geometric performance drop here.
#: only one /* */ style comment
- _ws1 = r'\s*(?:/[*].*?[*]/\s*)*'
+ _ws1 = r'\s*(?:/[*].*?[*]/\s*)?'
tokens = {
'whitespace': [