fixed indenting bug with case class/object, partial revert
--HG-- branch : pmacs2
This commit is contained in:
parent
d01e8adbde
commit
38f93f7faa
|
@ -52,20 +52,15 @@ class ScalaGrammar(Grammar):
|
|||
'scala.reserved', 'spaces', 'scala.type'),
|
||||
|
||||
# class, object, and trait
|
||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(class)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
||||
'scala.reserved', 'spaces', 'scala.class'),
|
||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(object)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
||||
'scala.reserved', 'spaces', 'scala.object'),
|
||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(trait)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
||||
'scala.reserved', 'spaces', 'scala.trait'),
|
||||
PatternRule('scala.class', '(?<=(?<![a-zA-Z0-9_])class )[^0-9:\[\](){} ][^:\[(){} ]*'),
|
||||
PatternRule('scala.object', '(?<=(?<![a-zA-Z0-9_])object )[^0-9:\[\](){} ][^:\[\](){} ]*'),
|
||||
PatternRule('scala.trait', '(?<=(?<![a-zA-Z0-9_])trait )[^0-9:\[\](){} ][^:\[\]{}() ]*'),
|
||||
|
||||
# method names
|
||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(def)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
||||
'scala.reserved', 'spaces', 'scala.def'),
|
||||
PatternRule('scala.def', '(?<=(?<![a-zA-Z0-9_])def )[^0-9:\[\](){} ][^:\[\]{}() ]*'),
|
||||
|
||||
# package names
|
||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(package)( +)([a-zA-Z0-9_.]+)',
|
||||
'scala.reserved', 'spaces', 'scala.package'),
|
||||
PatternRule('scala.package', '(?<=(?<![a-zA-Z0-9_])package )[a-zA-Z0-9_.]+'),
|
||||
|
||||
# used for type param lists and type parameterization
|
||||
RegionRule('sub', r'\[', SubTypeGrammar, r'\]'),
|
||||
|
@ -81,7 +76,7 @@ class ScalaGrammar(Grammar):
|
|||
# these are some constants that show up a lot
|
||||
PatternRule('scala.pseudo', '(?:true|null|false)(?!%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|macro|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|macro|lazy|import|implicit|if|forSome|for|finally|final|false|extends|else|do|def|class|catch|case object|case class|case|abstract)(?!%s)' % word),
|
||||
|
||||
PatternRule('scala.float', r'-?[0-9]+\.[0-9]*[Ff]?'), # FIXME
|
||||
|
||||
|
|
Loading…
Reference in New Issue