diff --git a/mode/scala.py b/mode/scala.py index 80baab4..0a79e11 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -31,10 +31,10 @@ 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-Z][a-zA-Z0-9_.]*'), PatternRule('spaces', ' +'), PatternRule('scala.annotation', '@[a-zA-Z_][a-zA-Z0-9_]*'), + RegionRule('scala.string', '"', StringGrammar, '"'), ] class ScalaGrammar(Grammar): @@ -43,25 +43,13 @@ 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|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'\)'), PatternRule('delimiter', r'(?:;|{|}|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), @@ -70,9 +58,6 @@ class ScalaGrammar(Grammar): PatternRule('spaces', r'(?:\t| )+'), PatternRule('eol', r'\n'), - #PatternRule('scala.def', '(?<=(?