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'),
|
'scala.reserved', 'spaces', 'scala.type'),
|
||||||
|
|
||||||
# class, object, and trait
|
# class, object, and trait
|
||||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(class)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
PatternRule('scala.class', '(?<=(?<![a-zA-Z0-9_])class )[^0-9:\[\](){} ][^:\[(){} ]*'),
|
||||||
'scala.reserved', 'spaces', 'scala.class'),
|
PatternRule('scala.object', '(?<=(?<![a-zA-Z0-9_])object )[^0-9:\[\](){} ][^:\[\](){} ]*'),
|
||||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(object)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
PatternRule('scala.trait', '(?<=(?<![a-zA-Z0-9_])trait )[^0-9:\[\](){} ][^:\[\]{}() ]*'),
|
||||||
'scala.reserved', 'spaces', 'scala.object'),
|
|
||||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(trait)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
|
||||||
'scala.reserved', 'spaces', 'scala.trait'),
|
|
||||||
|
|
||||||
# method names
|
# method names
|
||||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(def)( +)([^0-9:\[\( ][^:\[\( ]*)',
|
PatternRule('scala.def', '(?<=(?<![a-zA-Z0-9_])def )[^0-9:\[\](){} ][^:\[\]{}() ]*'),
|
||||||
'scala.reserved', 'spaces', 'scala.def'),
|
|
||||||
|
|
||||||
# package names
|
# package names
|
||||||
PatternMatchRule('x', r'(?<![a-zA-Z0-9_])(package)( +)([a-zA-Z0-9_.]+)',
|
PatternRule('scala.package', '(?<=(?<![a-zA-Z0-9_])package )[a-zA-Z0-9_.]+'),
|
||||||
'scala.reserved', 'spaces', 'scala.package'),
|
|
||||||
|
|
||||||
# used for type param lists and type parameterization
|
# used for type param lists and type parameterization
|
||||||
RegionRule('sub', r'\[', SubTypeGrammar, r'\]'),
|
RegionRule('sub', r'\[', SubTypeGrammar, r'\]'),
|
||||||
|
@ -81,7 +76,7 @@ class ScalaGrammar(Grammar):
|
||||||
# these are some constants that show up a lot
|
# these are some constants that show up a lot
|
||||||
PatternRule('scala.pseudo', '(?:true|null|false)(?!%s)' % word),
|
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
|
PatternRule('scala.float', r'-?[0-9]+\.[0-9]*[Ff]?'), # FIXME
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue