add hilighting for classes and functions

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-08-12 07:40:07 -04:00
parent c494da8b44
commit 990414dc34
1 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,10 @@ class ScalaGrammar(Grammar):
PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<|>|:|/|\+|-|\*|=)'), PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<|>|:|/|\+|-|\*|=)'),
PatternRule('scala.def', '(?<=(?<![a-zA-Z0-9_])def )[a-zA-Z_][a-zA-Z0-9_]*'),
PatternRule('scala.class', '(?<=(?<![a-zA-Z0-9_])class )[a-zA-Z_][a-zA-Z0-9_]*'),
PatternRule('scala.class', '(?<=(?<![a-zA-Z0-9_])object )[a-zA-Z_][a-zA-Z0-9_]*'),
PatternRule('scala.reserved', '(?:yield|with|while|var|val|type|true|try|trait|throw|this|super|sealed|return|protected|private|package|override|object|null|new|match|lazy|import|implicit|if|forSome|for|finally|final|false|extends|else|do|def|class|catch|case|abstract)(?!%s)' % word), PatternRule('scala.reserved', '(?:yield|with|while|var|val|type|true|try|trait|throw|this|super|sealed|return|protected|private|package|override|object|null|new|match|lazy|import|implicit|if|forSome|for|finally|final|false|extends|else|do|def|class|catch|case|abstract)(?!%s)' % word),
PatternRule('scala.integer', '-?(?:0|[1-9])[0-9]*[Ll]?'), PatternRule('scala.integer', '-?(?:0|[1-9])[0-9]*[Ll]?'),
@ -100,6 +104,9 @@ class Scala(Fundamental):
'scala.integer': ('default', 'default'), 'scala.integer': ('default', 'default'),
'scala.float': ('default', 'default'), 'scala.float': ('default', 'default'),
'scala.bareword': ('default', 'default'), 'scala.bareword': ('default', 'default'),
'scala.class': ('yellow', 'default'),
'scala.def': ('blue', 'default'),
} }
_bindings = { _bindings = {