diff options
author | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-12 23:55:27 -0400 |
---|---|---|
committer | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-12 23:55:27 -0400 |
commit | df61ba5e5541191c743adfc3c4efb0e73e102f00 (patch) | |
tree | 7f61882bd0eaaa069f5e81fe89fbc9943d7f7e71 /pygments/lexers/jvm.py | |
parent | 51d5e12de5378483a19209abd873f9932fd65458 (diff) | |
download | pygments-df61ba5e5541191c743adfc3c4efb0e73e102f00.tar.gz |
Match Java function name tokens even without leading whitespace
Diffstat (limited to 'pygments/lexers/jvm.py')
-rw-r--r-- | pygments/lexers/jvm.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py index b2fda960..e26e46c8 100644 --- a/pygments/lexers/jvm.py +++ b/pygments/lexers/jvm.py @@ -41,6 +41,11 @@ class JavaLexer(RegexLexer): (r'[^\S\n]+', Text), (r'//.*?\n', Comment.Single), (r'/\*.*?\*/', Comment.Multiline), + # method names + (r'((?:[^\W\d][\w\.\[\]<>]*\s+)+?)' # return arguments + r'([^\W\d]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Text, Operator)), (r'@[^\W\d][\w\.]*', Name.Decorator), (r'(assert|break|case|catch|continue|default|do|else|finally|for|' r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b', @@ -50,11 +55,6 @@ class JavaLexer(RegexLexer): r'transient|volatile)\b', Keyword.Declaration), (r'(boolean|byte|char|double|float|int|long|short|void)\b', Keyword.Type), - # method names - (r'^(\s*(?:[^\W\d][\w\.\[\]<>]*\s+)+?)' # return arguments - r'([^\W\d]\w*)' # method name - r'(\s*)(\()', # signature start - bygroups(using(this), Name.Function, Text, Operator)), (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), (r'(true|false|null)\b', Keyword.Constant), (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), 'class'), |