summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-05-06 16:49:45 +0200
committergbrandl <devnull@localhost>2008-05-06 16:49:45 +0200
commit64fb9ee79937768771d19cf198a7290b5931ccbd (patch)
tree45154940c29a1c8491d74bb3ba7ff5a52e7b07eb
parent4ecfa91c17edf0f6286642e0f568dc526268facf (diff)
downloadpygments-64fb9ee79937768771d19cf198a7290b5931ccbd.tar.gz
Fix function name highlighting in Java and C#, and interface names in Java.
-rw-r--r--CHANGES2
-rw-r--r--pygments/lexers/compiled.py10
-rw-r--r--pygments/lexers/dotnet.py6
3 files changed, 10 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index d6c6b0d4..f3276557 100644
--- a/CHANGES
+++ b/CHANGES
@@ -39,6 +39,8 @@ Version 1.0
- Fixes in the IRC and MuPad lexers.
+- Fix function and interface name highlighting in the Java lexer.
+
- Fix at-rule handling in the CSS lexer.
- Handle KeyboardInterrupts gracefully in pygmentize.
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 2e0f62f0..ca5bb2c4 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -856,9 +856,9 @@ class JavaLexer(RegexLexer):
tokens = {
'root': [
# method names
- (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.]*\s+)+?)' # return arguments
- r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
- r'(\s*)(\()', # signature start
+ (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
+ r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
+ r'(\s*)(\()', # signature start
bygroups(using(this), Name.Function, Text, Operator)),
(r'[^\S\n]+', Text),
(r'//.*?\n', Comment),
@@ -867,13 +867,13 @@ class JavaLexer(RegexLexer):
(r'(abstract|assert|break|case|catch|'
r'const|continue|default|do|else|enum|extends|final|'
r'finally|for|if|goto|implements|instanceof|'
- r'interface|native|new|package|private|protected|public|'
+ r'native|new|package|private|protected|public|'
r'return|static|strictfp|super|switch|synchronized|this|'
r'throw|throws|transient|try|volatile|while)\b', Keyword),
(r'(boolean|byte|char|double|float|int|long|short|void)\b',
Keyword.Type),
(r'(true|false|null)\b', Keyword.Constant),
- (r'(class)(\s+)', bygroups(Keyword, Text), 'class'),
+ (r'(class|interface)(\s+)', bygroups(Keyword, Text), 'class'),
(r'(import)(\s+)', bygroups(Keyword, Text), 'import'),
(r'"(\\\\|\\"|[^"])*"', String),
(r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index 60663c4a..832f21f5 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -76,9 +76,9 @@ class CSharpLexer(RegexLexer):
tokens[levelname] = {
'root': [
# method names
- (r'^([ \t]*(?:' + cs_ident + r'\s+)+?)' # return arguments
- r'(' + cs_ident + ')' # method name
- r'(\s*)(\()', # signature start
+ (r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
+ r'(' + cs_ident + ')' # method name
+ r'(\s*)(\()', # signature start
bygroups(using(this), Name.Function, Text, Punctuation)),
(r'^\s*\[.*?\]', Name.Attribute),
(r'[^\S\n]+', Text),