     (goto-char (match-end 0))
     t))
 
-(defun scala-match-and-skip-type-args (limit)
-  (when (looking-at (concat "[[,]\\s *\\(" scala-ident-re "\\)?\\]?"))
-    (goto-char (match-end 0))
-    t))
+(defun scala-match-and-skip-type-param (limit)
+  (scala-when-looking-at "\\s *[[,]\\s *"
+    (let ((matches (scala-make-match '((scala-forward-type-param . t)))))
+      (scala-when-looking-at "\\s *\\]")
+      (set-match-data matches)
+      t)))
 
 (defun scala-match-and-skip-result-type (limit)
-  (when (looking-at "\\s *:\\s *")
-    (goto-char (match-end 0))
+  (scala-when-looking-at "\\s *:\\s *"
     (set-match-data (list (point-marker)
                           (progn (scala-forward-type) (point-marker))))
     t))

(require 'cl)
(require 'regexp-opt)

(defconst scala-mode-version "0.2 ($Revision$)")
(defconst scala-bug-e-mail "Michel.Schinz@epfl.ch")
(defconst scala-web-url "http://lampwww.epfl.ch/scala/")


(define-key scala-mode-map [(control c)(control l)] 'scala-load-file)
(define-key scala-mode-map [(control c)(control r)] 'scala-eval-region)
(define-key scala-mode-map [(control c)(control b)] 'scala-eval-buffer)

(define-key scala-mode-map [(control c)(control c)] 'comment-region)

(define-key scala-mode-map "}" 'scala-electric-brace)

