From bd90421ddc71703cde74d3c853b8634939bf1880 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 10 Sep 2012 15:24:47 -0600 Subject: [PATCH] start working on support classpath in mode.scala --HG-- branch : pmacs2 --- mode/scala.py | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/mode/scala.py b/mode/scala.py index 80baab4..0a79e11 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -31,10 +31,10 @@ class StringGrammar(Grammar): class SubTypeGrammar(Grammar): pass SubTypeGrammar.rules = [ RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), - #PatternRule('scala.type', '(?:[a-zA-Z0-9_.]+| *=> *)+'), PatternRule('scala.type', '[A-Z][a-zA-Z0-9_.]*'), PatternRule('spaces', ' +'), PatternRule('scala.annotation', '@[a-zA-Z_][a-zA-Z0-9_]*'), + RegionRule('scala.string', '"', StringGrammar, '"'), ] class ScalaGrammar(Grammar): @@ -43,25 +43,13 @@ class ScalaGrammar(Grammar): RegionRule('scala.comment', r'/\*', NestedCommentGrammar, r'\*/'), RegionRule('scala.script', r'#!.+$', ShGrammar, r'!#'), - #PatternMatchRule('x', r'(? *)+)', - # 'delimiter', 'scala.type'), - #PatternMatchRule('x', r'(? *)+)', - # 'delimiter', 'spaces', 'scala.type'), PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)([a-zA-Z0-9_]+)', 'delimiter', 'scala.type'), PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)( +)([a-zA-Z0-9_]+)', 'delimiter', 'spaces', 'scala.type'), - #PatternMatchRule('x', r'(extends|with|new)( +)([a-zA-Z0-9_.]+)', - # 'scala.reserved', 'spaces', 'scala.type'), - #PatternMatchRule('x', r'(with)( +)([a-zA-Z0-9_.]+)', - # 'scala.reserved', 'spaces', 'scala.type'), - #PatternMatchRule('x', r'(new)( +)([a-zA-Z0-9_.]+)', - # 'scala.reserved', 'spaces', 'scala.type'), - PatternRule('scala.def', '(?<=(?|:|/|\+|-|\*|=)'), RegionRule('sub', r'(?<=:)\(', SubTypeGrammar, r'\)'), PatternRule('delimiter', r'(?:;|{|}|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), @@ -70,9 +58,6 @@ class ScalaGrammar(Grammar): PatternRule('spaces', r'(?:\t| )+'), PatternRule('eol', r'\n'), - #PatternRule('scala.def', '(?<=(?