diff --git a/method/git.py b/method/git.py index d6edfd7..bd5ece8 100644 --- a/method/git.py +++ b/method/git.py @@ -176,7 +176,7 @@ class GitBlame(VcBlame): '''show blame output for the current version in SVN''' # rev, user, date, [time], [timezone], [date-str], content num_fields = 3 - line_re = re.compile(r'^\^*([0-9a-f]+) \(([a-zA-Z0-9_]+|Not Committed Yet) +([-0-9]+) [:0-9]+ +[-\+]\d{4} +\d+\) (.*)\n$') + line_re = re.compile(r'^\^*([0-9a-f]+) \(([a-zA-Z0-9_ ]+|Not Committed Yet) +([-0-9]+) [:0-9]+ +[-\+]\d{4} +\d+\) (.*)\n$') prefix_fmt = '[g:d:*]%*s [c:d:*]%-*s [b:d:*]%*s[d:d:*]' pretest_err_msg = 'Git is not installed' _is_method = True diff --git a/mode/scala.py b/mode/scala.py index ab6a80b..1e9cb99 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -30,8 +30,9 @@ class StringGrammar(Grammar): class SubTypeGrammar(Grammar): pass SubTypeGrammar.rules = [ RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), - PatternRule('scala.type', '[a-zA-Z0-9_]+'), + PatternRule('scala.type', '(?:[a-zA-Z0-9_.]+| *=> *)+'), PatternRule('spaces', ' +'), + PatternRule('scala.annotation', '@[a-zA-Z_][a-zA-Z0-9_]*'), ] class ScalaGrammar(Grammar): @@ -40,18 +41,18 @@ class ScalaGrammar(Grammar): RegionRule('scala.comment', r'/\*', NestedCommentGrammar, r'\*/'), RegionRule('scala.script', r'#!.+$', ShGrammar, r'!#'), - PatternMatchRule('x', r'(? *)+)', 'delimiter', 'scala.type'), - PatternMatchRule('x', r'(? *)+)', 'delimiter', 'spaces', 'scala.type'), #PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)([a-zA-Z0-9_]+)', # 'delimiter', 'scala.type'), #PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)( +)([a-zA-Z0-9_]+)', # 'delimiter', 'spaces', 'scala.type'), - PatternMatchRule('x', r'(extends)( +)([a-zA-Z0-9_]+)', + PatternMatchRule('x', r'(extends)( +)([a-zA-Z0-9_.]+)', 'scala.reserved', 'spaces', 'scala.type'), - PatternMatchRule('x', r'(with)( +)([a-zA-Z0-9_]+)', + PatternMatchRule('x', r'(with)( +)([a-zA-Z0-9_.]+)', 'scala.reserved', 'spaces', 'scala.type'), #PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), @@ -69,7 +70,7 @@ class ScalaGrammar(Grammar): PatternRule('scala.object', '(?<=(?