parent
ac0fb2afb2
commit
9ef9c4b633
|
@ -31,6 +31,8 @@ class ScalaGrammar(Grammar):
|
||||||
PatternRule('spaces', r'(?:\t| )+'),
|
PatternRule('spaces', r'(?:\t| )+'),
|
||||||
PatternRule('eol', r'\n'),
|
PatternRule('eol', r'\n'),
|
||||||
|
|
||||||
|
PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<|>|:|/|\+|-|\*|=)'),
|
||||||
|
|
||||||
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]?'),
|
||||||
|
@ -44,7 +46,12 @@ class ScalaGrammar(Grammar):
|
||||||
PatternRule('scala.char', r"'(?:[^'\\]|\\u[0-9A-Fa-f]{4}|\\[0-7]{1,3}|\\[btnfr\"'\\])'"),
|
PatternRule('scala.char', r"'(?:[^'\\]|\\u[0-9A-Fa-f]{4}|\\[0-7]{1,3}|\\[btnfr\"'\\])'"),
|
||||||
RegionRule('scala.string', '"', StringGrammar, '"'),
|
RegionRule('scala.string', '"', StringGrammar, '"'),
|
||||||
PatternRule('scala.symbol', "'[a-zA-Z_][a-zA-Z0-9_]*"),
|
PatternRule('scala.symbol', "'[a-zA-Z_][a-zA-Z0-9_]*"),
|
||||||
PatternRule('scalar.null', 'null'),
|
|
||||||
|
PatternRule('scala.annotation', '@[a-zA-Z_][a-zA-Z0-9_]*'),
|
||||||
|
|
||||||
|
PatternRule('scala.bareword', '[a-zA-Z_][a-zA-Z0-9_]*'),
|
||||||
|
|
||||||
|
PatternRule('scala.null', 'null'),
|
||||||
]
|
]
|
||||||
|
|
||||||
class Scala(Fundamental):
|
class Scala(Fundamental):
|
||||||
|
@ -56,7 +63,17 @@ class Scala(Fundamental):
|
||||||
opentags = {'(': ')', '[': ']', '{': '}'}
|
opentags = {'(': ')', '[': ']', '{': '}'}
|
||||||
closetokens = ('delimiter',)
|
closetokens = ('delimiter',)
|
||||||
closetags = {')': '(', ']': '[', '}': '{'}
|
closetags = {')': '(', ']': '[', '}': '{'}
|
||||||
colors = {}
|
|
||||||
|
colors = {
|
||||||
|
'scala.annotation': ('magenta', 'default'),
|
||||||
|
'scala.bool': ('magenta', 'default'),
|
||||||
|
'scala.null': ('magenta', 'default'),
|
||||||
|
|
||||||
|
'scala.integer': ('default', 'default'),
|
||||||
|
'scala.float': ('default', 'default'),
|
||||||
|
'scala.bareword': ('default', 'default'),
|
||||||
|
}
|
||||||
|
|
||||||
_bindings = {
|
_bindings = {
|
||||||
'close-paren': (')',),
|
'close-paren': (')',),
|
||||||
'close-brace': ('}',),
|
'close-brace': ('}',),
|
||||||
|
|
Loading…
Reference in New Issue