From 8f82922870ac15a4fd334a3c8c9359a269a40d6b Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Thu, 23 Sep 2010 23:35:19 -0400 Subject: [PATCH] fix some bugs and make scala mode better --HG-- branch : pmacs2 --- application.py | 12 ++++---- mode/scala.py | 75 ++++++++++++++++++++++++++++++++++++++++---------- tab.py | 34 +++++++++++++---------- 3 files changed, 87 insertions(+), 34 deletions(-) diff --git a/application.py b/application.py index ab80a92..33ce5ef 100755 --- a/application.py +++ b/application.py @@ -661,11 +661,13 @@ class Application(object): # create directories under the application path def mkdirs(self, *parts): - path = self.getpath() - for part in parts: - path = os.path.join(path, part) - if not os.path.exists(path): - os.mkdir(path) + path = os.path.join(self.getpath(), *parts) + if not os.path.exists(path): + os.makedirs(path) + #for part in parts: + # path = os.path.join(path, part) + # if not os.path.exists(path): + # os.mkdir(path) # load user configuration NOW def loadrc(self): diff --git a/mode/scala.py b/mode/scala.py index a37ab18..1215e62 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -7,6 +7,7 @@ from method.shell import Interact from method import Method, arg import default import urllib2 +import os chr1 = '[a-zA-Z_]' chr2 = '[a-zA-Z_0-9]' @@ -29,6 +30,11 @@ class ScalaGrammar(Grammar): PatternRule('scala.comment', '//.*$'), RegionRule('scala.comment', r'/\*', NestedCommentGrammar, r'\*/'), + 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'), + PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), RegionRule('scala.inline', r'(?:^| )(?=<[a-zA-Z_])', XMLGrammar, '^[ \t]*$'), @@ -36,10 +42,14 @@ class ScalaGrammar(Grammar): PatternRule('eol', r'\n'), PatternRule('scala.def', '(?<=(?