summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorValentin Lorentz <progval@progval.net>2015-07-21 16:09:24 +0200
committerValentin Lorentz <progval@progval.net>2015-07-21 16:09:24 +0200
commit4623af72fc7d005b3ab02fb9e9ca16e1e667b4c1 (patch)
treed9073c0bd4336ac4a77b4f60b5394c50e43a695b /pygments
parentd5297f6110ef92263557a851e0564fbed7023dae (diff)
downloadpygments-4623af72fc7d005b3ab02fb9e9ca16e1e667b4c1.tar.gz
Add support for function keywords in C/C++.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/c_cpp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index bbac406e..9904f294 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -87,15 +87,17 @@ class CFamilyLexer(RegexLexer):
(r'((?:[\w*\s])+?(?:\s|[*]))' # return arguments
r'([a-zA-Z_]\w*)' # method name
r'(\s*\([^;]*?\))' # signature
- r'(' + _ws + r')?(\{)',
+ r'([^;]*)?'
+ r'(\{)',
bygroups(using(this), Name.Function, using(this), using(this),
- Punctuation),
+ Keyword, Punctuation),
'function'),
# function declarations
(r'((?:[\w*\s])+?(?:\s|[*]))' # return arguments
r'([a-zA-Z_]\w*)' # method name
r'(\s*\([^;]*?\))' # signature
- r'(' + _ws + r')?(;)',
+ r'([^;]*)?'
+ r'(;)',
bygroups(using(this), Name.Function, using(this), using(this),
Punctuation)),
default('statement'),