From eed9887e8fb6c8d7cf755de755b745639a1f9577 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Fri, 10 Sep 2010 00:18:43 -0400 Subject: [PATCH] improvements to scala mode --HG-- branch : pmacs2 --- mode/scala.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/mode/scala.py b/mode/scala.py index b6d3ebf..3330029 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -1,11 +1,9 @@ -#import commands from tab import StackTabber2 -#from method import Method from mode import Fundamental from lex import Grammar, PatternRule, RegionRule, PatternMatchRule -from mode.python import StringGrammar1, StringGrammar2 -#from mode.pipe import Pipe -#from method.shell import Interact +from mode.xml import XMLGrammar +from mode.pipe import Pipe +from method.shell import Interact chr1 = '[a-zA-Z_]' chr2 = '[a-zA-Z_0-9]' @@ -28,11 +26,11 @@ class ScalaGrammar(Grammar): PatternRule('scala.comment', '//.*$'), RegionRule('scala.comment', r'/\*', NestedCommentGrammar, r'\*/'), + PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), + PatternRule('spaces', r'(?:\t| )+'), PatternRule('eol', r'\n'), - PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<|>|:|/|\+|-|\*|=)'), - PatternRule('scala.def', '(?<=(?