Commits

gbrandl  committed 4ceaaa1

Fix function name highlighting in Java and C#, and interface names in Java.

  • Participants
  • Parent commits 9005e1c
  • Branches trunk

Comments (0)

Files changed (3)

 
 - 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.

File pygments/lexers/compiled.py

     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),
             (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),

File pygments/lexers/dotnet.py

         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),