summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2016-05-31 21:46:37 -0700
committerTim Hatch <tim@timhatch.com>2016-05-31 21:46:37 -0700
commitd352bbdf4d2f6265d4ee934799775b044eb47678 (patch)
tree41072489f9b3c62d21ef8dcfe5ee93af91818e5f /pygments
parentb2eb5cbe37ece98b456c6d2ae167e5d04378a985 (diff)
downloadpygments-d352bbdf4d2f6265d4ee934799775b044eb47678.tar.gz
Allow open c-style comments.
Fixes #1114
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/c_cpp.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index a8d75c0a..2a2419d4 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -46,8 +46,10 @@ class CFamilyLexer(RegexLexer):
(r'\n', Text),
(r'\s+', Text),
(r'\\\n', Text), # line continuation
- (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
- (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+ (r'//(\n|[\w\W]*?[^\\]\n)', Comment.Single),
+ (r'/(\\\n)?[*][\w\W]*?[*](\\\n)?/', Comment.Multiline),
+ # Open until EOF, so no ending delimeter
+ (r'/(\\\n)?[*][\w\W]*', Comment.Multiline),
],
'statements': [
(r'(L?)(")', bygroups(String.Affix, String), 'string'),