From d03d3b247f4ca7f2b802d6731916f287aefb073a Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Tue, 8 Nov 2011 22:30:23 -0500 Subject: [PATCH] better support for type names --HG-- branch : pmacs2 --- mode/scala.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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', '(?<=(?