diff --git a/mode/scala.py b/mode/scala.py index 1e9cb99..e9efc67 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -50,10 +50,14 @@ class ScalaGrammar(Grammar): #PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)( +)([a-zA-Z0-9_]+)', # 'delimiter', 'spaces', 'scala.type'), - PatternMatchRule('x', r'(extends)( +)([a-zA-Z0-9_.]+)', - 'scala.reserved', 'spaces', 'scala.type'), - PatternMatchRule('x', r'(with)( +)([a-zA-Z0-9_.]+)', + PatternMatchRule('x', r'(extends|with|new)( +)([a-zA-Z0-9_.]+)', 'scala.reserved', 'spaces', 'scala.type'), + #PatternMatchRule('x', r'(with)( +)([a-zA-Z0-9_.]+)', + # 'scala.reserved', 'spaces', 'scala.type'), + #PatternMatchRule('x', r'(new)( +)([a-zA-Z0-9_.]+)', + # 'scala.reserved', 'spaces', 'scala.type'), + + PatternRule('scala.def', '(?<=(?|:|/|\+|-|\*|=)'), RegionRule('sub', r'(?<=:)\(', SubTypeGrammar, r'\)'), @@ -64,7 +68,8 @@ class ScalaGrammar(Grammar): PatternRule('spaces', r'(?:\t| )+'), PatternRule('eol', r'\n'), - PatternRule('scala.def', '(?<=(?