better support for type names

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2011-11-08 22:30:23 -05:00
parent 8a24c92379
commit d03d3b247f
1 changed files with 9 additions and 4 deletions

View File

@ -50,10 +50,14 @@ class ScalaGrammar(Grammar):
#PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)( +)([a-zA-Z0-9_]+)', #PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)( +)([a-zA-Z0-9_]+)',
# 'delimiter', 'spaces', 'scala.type'), # 'delimiter', 'spaces', 'scala.type'),
PatternMatchRule('x', r'(extends)( +)([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'), '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', '(?<=(?<![a-zA-Z0-9_])def )[^0-9:\[\( ][^:\[\( ]*'),
#PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), #PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'),
RegionRule('sub', r'(?<=:)\(', SubTypeGrammar, r'\)'), RegionRule('sub', r'(?<=:)\(', SubTypeGrammar, r'\)'),
@ -64,7 +68,8 @@ class ScalaGrammar(Grammar):
PatternRule('spaces', r'(?:\t| )+'), PatternRule('spaces', r'(?:\t| )+'),
PatternRule('eol', r'\n'), PatternRule('eol', r'\n'),
PatternRule('scala.def', '(?<=(?<![a-zA-Z0-9_])def )[a-zA-Z_][a-zA-Z0-9_]*'), #PatternRule('scala.def', '(?<=(?<![a-zA-Z0-9_])def )[a-zA-Z_][a-zA-Z0-9_]*'),
#PatternRule('scala.def', '(?<=(?<![a-zA-Z0-9_])def )[^0-9\[\( ][^\[\( ]*'),
PatternRule('scala.class', '(?<=(?<![a-zA-Z0-9_])class )[a-zA-Z_][a-zA-Z0-9_]*'), PatternRule('scala.class', '(?<=(?<![a-zA-Z0-9_])class )[a-zA-Z_][a-zA-Z0-9_]*'),
PatternRule('scala.object', '(?<=(?<![a-zA-Z0-9_])object )[a-zA-Z_][a-zA-Z0-9_]*'), PatternRule('scala.object', '(?<=(?<![a-zA-Z0-9_])object )[a-zA-Z_][a-zA-Z0-9_]*'),