emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/scala-mode 94f34b2 077/217: Rm trailing whitespace from al


From: ELPA Syncer
Subject: [nongnu] elpa/scala-mode 94f34b2 077/217: Rm trailing whitespace from all project files.
Date: Sun, 29 Aug 2021 11:30:47 -0400 (EDT)

branch: elpa/scala-mode
commit 94f34b28f216efca869a47defd1720aa35a68cb3
Author: Evan Meagher <evm@twitter.com>
Commit: Evan Meagher <evm@twitter.com>

    Rm trailing whitespace from all project files.
---
 LICENSE                 |   2 +-
 Makefile                |   2 +-
 scala-mode-indent.el    |  98 ++++++++++++++++++------------------
 scala-mode-lib.el       |   4 +-
 scala-mode-map.el       |   6 +--
 scala-mode-paragraph.el |  12 ++---
 scala-mode-syntax.el    | 130 ++++++++++++++++++++++++------------------------
 scala-mode.el           |   8 +--
 8 files changed, 131 insertions(+), 131 deletions(-)

diff --git a/LICENSE b/LICENSE
index 5466088..e67cc34 100644
--- a/LICENSE
+++ b/LICENSE
@@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person 
obtaining a copy of
 
 The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
\ No newline at end of file
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
diff --git a/Makefile b/Makefile
index 21c2d87..3719764 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ SOURCE_DIR             = $(ROOT)
 # Emacs Lisp
 ELISP_COMMAND          ?= emacs
 ELISP_OPTIONS          += -batch -no-site-file
-ELISP_OPTIONS           += -L $(ROOT) 
+ELISP_OPTIONS           += -L $(ROOT)
 ELISP_OPTIONS          += -f batch-byte-compile
 
 
diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index 7a89efc..9b2618a 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -46,7 +46,7 @@ val x = try {
 def foo(x: Int, y: List[Int]
         z: Int)
 
-val x = foo(1, List(1, 2, 3) map (i => 
+val x = foo(1, List(1, 2, 3) map (i =>
               i + 1
             ), 2)
 
@@ -55,7 +55,7 @@ When nil, the same will indent as
 def foo(x: Int, y: List[Int]
         z: Int)
 
-val x = foo(1, List(1, 2, 3) map (i => 
+val x = foo(1, List(1, 2, 3) map (i =>
     i + 1
   ), 2)
 "
@@ -94,7 +94,7 @@ val x = if (foo)
 (defcustom scala-indent:default-run-on-strategy 2
   "What strategy to use for detecting run-on lines, i.e. lines
 that continue a statement from the previous line. Possible values
-are: 
+are:
 
 'reluctant', which marks only lines that begin with -- or
 that follow a line that ends with -- a reserved word that cannot start
@@ -136,7 +136,7 @@ Scaladoc behavior of indenting comment lines to the second 
asterisk."
 (defun scala-indent:toggle-effective-run-on-strategy ()
   "If effective run-on strategy is not set, it is set as follows:
 - if default is eager or operators, then it is set to reluctant
-- if default is reluctant, then it is set to eager. If it is set, 
+- if default is reluctant, then it is set to eager. If it is set,
 it is nilled."
   (if scala-indent:effective-run-on-strategy
       (setq scala-indent:effective-run-on-strategy nil)
@@ -169,21 +169,21 @@ it is nilled."
     (setq scala-indent:default-run-on-strategy new-strategy)
 ;    (message "scala-indent:default-run-on-strategy set to %s" 
scala-indent:default-run-on-strategy)
     ))
-          
+
 (defun scala-indent:backward-sexp-to-beginning-of-line ()
   "Skip sexps backwards until reaches beginning of line (i.e. the
 point is at the first non whitespace or comment character). It
 does not move outside enclosin list. Returns the current point or
 nil if the beginning of line could not be reached because of
 enclosing list."
-  (let ((code-beg (scala-lib:point-after 
+  (let ((code-beg (scala-lib:point-after
                    (scala-syntax:beginning-of-code-line))))
-    (ignore-errors 
+    (ignore-errors
       (while (> (point) code-beg)
         (scala-syntax:backward-sexp)
-        (when (< (point) code-beg) 
+        (when (< (point) code-beg)
           ;; moved to previous line, set new target
-          (setq code-beg (scala-lib:point-after 
+          (setq code-beg (scala-lib:point-after
                           (scala-syntax:beginning-of-code-line))))))
     (unless (> (point) code-beg)
       (point))))
@@ -200,10 +200,10 @@ scala-indent:align-parameters is non-nil."
 (defun scala-indent:value-expression-lead (start anchor &optional not-block-p)
   ;; calculate an indent lead. The lead is one indent step if there is
   ;; a '=' between anchor and start, otherwise 0.
-  (if (and scala-indent:indent-value-expression 
-           (ignore-errors 
+  (if (and scala-indent:indent-value-expression
+           (ignore-errors
              (save-excursion
-               (let ((block-beg (if not-block-p 
+               (let ((block-beg (if not-block-p
                                     start
                                   (nth 1 (syntax-ppss start)))))
                  (goto-char anchor)
@@ -211,7 +211,7 @@ scala-indent:align-parameters is non-nil."
       scala-indent:step 0))
 
 ;;;
-;;; Run-on 
+;;; Run-on
 ;;;
 
 (defconst scala-indent:mustNotTerminate-keywords-re
@@ -220,13 +220,13 @@ scala-indent:align-parameters is non-nil."
 expression")
 
 (defconst scala-indent:mustNotTerminate-line-beginning-re
-  (concat "\\(" scala-indent:mustNotTerminate-keywords-re 
+  (concat "\\(" scala-indent:mustNotTerminate-keywords-re
           "\\|:\\("  scala-syntax:after-reserved-symbol-re "\\)\\)")
   "All keywords and symbols that cannot terminate a expression
 and must be handled by run-on. Reserved-symbols not included.")
 
 (defconst scala-indent:mustTerminate-re
-  (concat "\\([,;\u21D2]\\|=>?" scala-syntax:end-of-code-line-re 
+  (concat "\\([,;\u21D2]\\|=>?" scala-syntax:end-of-code-line-re
           "\\|\\s(\\|" scala-syntax:empty-line-re "\\)")
   "Symbols that must terminate an expression or start a
 sub-expression, i.e the following expression cannot be a
@@ -234,9 +234,9 @@ run-on. This includes only parenthesis, '=', '=>', ',' and 
';'
 and the empty line")
 
 (defconst scala-indent:mustNotContinue-re
-  (regexp-opt '("abstract" "catch" "case" "class" "def" "do" "else" "final" 
+  (regexp-opt '("abstract" "catch" "case" "class" "def" "do" "else" "final"
                 "finally" "for" "if" "implicit" "import" "lazy" "new" "object"
-                "override" "package" "private" "protected" "return" "sealed" 
+                "override" "package" "private" "protected" "return" "sealed"
                 "throw" "trait" "try" "type" "val" "var" "while" "yield")
               'words)
   "Words that we don't want to continue the previous line")
@@ -257,7 +257,7 @@ and are infact a sign of run-on. Reserved-symbols not 
included.")
       ;; Note: ofcourse this 'cond' could be written as one big boolean
       ;; expression, but I doubt that would be so readable and
       ;; maintainable
-      (cond 
+      (cond
        ;; NO: this line starts with close parenthesis
        ((= (char-syntax (char-after)) ?\))
         nil)
@@ -269,7 +269,7 @@ and are infact a sign of run-on. Reserved-symbols not 
included.")
               (scala-syntax:looking-back-token scala-indent:mustTerminate-re)))
         nil)
        ;; YES: in a region where newlines are disabled
-       ((and (scala-syntax:newlines-disabled-p) 
+       ((and (scala-syntax:newlines-disabled-p)
              (not (= strategy scala-indent:keywords-only-strategy)))
         t)
        ;; NO: this line starts with a keyword that starts a new
@@ -316,11 +316,11 @@ and are infact a sign of run-on. Reserved-symbols not 
included.")
        ((= strategy scala-indent:reluctant-strategy)
         nil)
        ;; YES: this line starts with opchars
-       ((save-excursion 
+       ((save-excursion
           (< 0 (skip-chars-forward scala-syntax:opchar-group)))
         t)
        ;; YES: prev line ends with opchars
-       ((save-excursion 
+       ((save-excursion
           (scala-syntax:skip-backward-ignorable)
           (> 0 (skip-chars-backward scala-syntax:opchar-group)))
         t)
@@ -329,7 +329,7 @@ and are infact a sign of run-on. Reserved-symbols not 
included.")
 
 (defun scala-indent:run-on-line-p (&optional point strategy)
   "Returns t if the current point (or point at 'point) is on a
-line that is a run-on from a previous line." 
+line that is a run-on from a previous line."
   (save-excursion
     (when point (goto-char point))
     (scala-syntax:beginning-of-code-line)
@@ -365,7 +365,7 @@ is not on a run-on line."
                (- (* 2 scala-indent:step)
                   (skip-chars-forward "|")))
       (goto-char start)
-      (cond 
+      (cond
        ;; some keywords get double indent
        ((or (looking-at scala-indent:double-indent-re)
             (scala-syntax:looking-back-token scala-indent:double-indent-re))
@@ -397,7 +397,7 @@ nil. Also, the previous line must not be with '}'"
     (when (looking-at scala-indent:forms-align-re)
       (goto-char (match-beginning 0))
       (point))))
-    
+
 
 (defun scala-indent:goto-forms-align-anchor (&optional point)
   "Moves back to the point whose column will be used as the
@@ -413,7 +413,7 @@ special word found. Special words include 'yield', 'else',
                  (goto-char (match-beginning 0))
                  (= (match-beginning 0) (scala-lib:point-after 
(scala-syntax:beginning-of-code-line)))))
           (goto-char (match-beginning 0))
-        (let ((anchor 
+        (let ((anchor
                (cond ((looking-at "\\<yield\\>")
                       ;; align with 'for'
                       (if (scala-syntax:search-backward-sexp "\\<for\\>")
@@ -460,11 +460,11 @@ special word found. Special words include 'yield', 'else',
   (if (not scala-indent:align-parameters)
       (progn (back-to-indentation) (point))
     (forward-comment (buffer-size))
-    (if (= (line-number-at-pos point) 
+    (if (= (line-number-at-pos point)
            (line-number-at-pos))
         (goto-char point)
       (beginning-of-line))
-    
+
     ;; align list with first non-whitespace character
     (skip-syntax-forward " ")
     (point)))
@@ -478,7 +478,7 @@ point or nil if the point is not in a list element > 1."
       (scala-indent:goto-list-anchor-impl list-beg))))
 
 (defun scala-indent:resolve-list-step (start anchor)
-  (if scala-indent:align-parameters 
+  (if scala-indent:align-parameters
       0
     (scala-indent:resolve-block-step start anchor)))
 
@@ -557,8 +557,8 @@ keyword, or nil if not."
       (if (looking-at scala-indent:control-keywords-re)
           (point)
         (when (scala-indent:backward-sexp-to-beginning-of-line)
-          (scala-indent:goto-run-on-anchor 
-           nil 
+          (scala-indent:goto-run-on-anchor
+           nil
            scala-indent:keywords-only-strategy))
         (scala-indent:align-anchor)
         (point)))))
@@ -576,8 +576,8 @@ keyword, or nil if not."
 (defun scala-indent:goto-block-anchor (&optional point)
   "Moves back to the point whose column will be used as the
 anchor for calculating block indent for current point (or point
-'point'). Returns point or (point-min) if not inside a block." 
-  (let ((block-beg (nth 1 (syntax-ppss 
+'point'). Returns point or (point-min) if not inside a block."
+  (let ((block-beg (nth 1 (syntax-ppss
                            (scala-lib:point-after (beginning-of-line))))))
     (when block-beg
       ;; check if the opening paren is the first on the line,
@@ -587,12 +587,12 @@ anchor for calculating block indent for current point (or 
point
       (if (= (point) (scala-lib:point-after
                       (scala-syntax:beginning-of-code-line)))
           (point)
-        (goto-char (or (scala-syntax:looking-back-token 
-                        scala-syntax:body-start-re 3) 
+        (goto-char (or (scala-syntax:looking-back-token
+                        scala-syntax:body-start-re 3)
                        (point)))
         (scala-syntax:backward-parameter-groups)
         (when (scala-indent:backward-sexp-to-beginning-of-line)
-          (scala-indent:goto-run-on-anchor nil 
+          (scala-indent:goto-run-on-anchor nil
                                            
scala-indent:keywords-only-strategy))
         (scala-indent:align-anchor)
         (point)))))
@@ -600,19 +600,19 @@ anchor for calculating block indent for current point (or 
point
 (defun scala-indent:resolve-block-step (start anchor)
   "Resolves the appropriate indent step for block line at position
 'start' relative to the block anchor 'anchor'."
-  (let 
+  (let
       ((lead (scala-indent:value-expression-lead start anchor)))
     (cond
      ;; at end of buffer
      ((= start (point-max)) (+ scala-indent:step lead))
      ;; block close parentheses line up with anchor in normal case
      ((= (char-syntax (char-after start)) ?\))
-      (+ 0 lead)) 
+      (+ 0 lead))
      ;; case-lines indent normally, regardless of where they are
      ((scala-syntax:looking-at-case-p start)
       (+ scala-indent:step lead))
      ;; other than case-line in case-block get double indent
-     ((save-excursion 
+     ((save-excursion
         (goto-char (1+ (or (nth 1 (syntax-ppss start)) 0)))
         (forward-comment (buffer-size))
         (and (scala-syntax:looking-at-case-p)
@@ -620,7 +620,7 @@ anchor for calculating block indent for current point (or 
point
       (+ (* 2 scala-indent:step) lead))
      ;; normal block line
      (t  (+ scala-indent:step lead)))))
-  
+
 ;;;
 ;;; Open parentheses
 ;;;
@@ -630,7 +630,7 @@ anchor for calculating block indent for current point (or 
point
 if the current point (or point 'point') is on a line that starts
 with an opening parentheses, or nil if not."
   (save-excursion
-    (when point (goto-char point))    
+    (when point (goto-char point))
     (scala-syntax:beginning-of-code-line)
     (if (looking-at "\\s(") (point) nil)))
 
@@ -657,7 +657,7 @@ start with opening parenthesis."
         (let ((curry-beg (point)))
           (forward-char)
           (forward-comment (buffer-size))
-          (if (= (line-number-at-pos curry-beg) 
+          (if (= (line-number-at-pos curry-beg)
                  (line-number-at-pos))
               (goto-char curry-beg)
             nil)))
@@ -666,7 +666,7 @@ start with opening parenthesis."
         nil) ; let body rule handle it
        ;; case 4
        ((and (= (char-after) ?\{)
-             (scala-indent:goto-run-on-anchor 
+             (scala-indent:goto-run-on-anchor
               nil scala-indent:keywords-only-strategy)) ; use customized 
strategy
         (point))
        ;; case 3
@@ -674,7 +674,7 @@ start with opening parenthesis."
        ;; (scala-syntax:skip-backward-ignorable)
        ;; (back-to-indentation)
        ;; (point))
-       (t 
+       (t
         nil)
        ))))
 
@@ -706,7 +706,7 @@ previous line, if any."
                        (forward-comment -1))
               (setq pos (point))))
       (goto-char pos))))
-    
+
 ;;;
 ;;; Indentation engine
 ;;;
@@ -724,7 +724,7 @@ nothing was applied."
              (indent-statement (cadr rule-indent))
              (anchor (funcall rule-statement point)))
         (if anchor
-            (progn 
+            (progn
               (if scala-mode:debug-messages
                   (message "indenting acording to %s at %d for pos %d for 
point %s" rule-statement anchor pos point))
               (when (/= anchor (point))
@@ -732,7 +732,7 @@ nothing was applied."
               (+ (current-column)
                  (save-excursion
                    (if (functionp indent-statement)
-                       (funcall indent-statement pos anchor) 
+                       (funcall indent-statement pos anchor)
                      (eval indent-statement)))))
           (scala-indent:apply-indent-rules (cdr rule-indents)))))))
 
@@ -780,7 +780,7 @@ strings"
   (let ((state (save-excursion (syntax-ppss (line-beginning-position)))))
     (if (not (nth 8 state)) ;; 8 = start pos of comment or string, nil if none
         (scala-indent:indent-code-line strategy)
-      (scala-indent:indent-line-to 
+      (scala-indent:indent-line-to
        (cond ((integerp (nth 4 state))    ;; 4 = nesting level of multi-line 
comment
               (scala-indent:scaladoc-indent (nth 8 state)))
              ((eq t (nth 3 state))   ;; 3 = t for multi-line string
@@ -797,7 +797,7 @@ strings"
 (defun scala-indent:indent-with-reluctant-strategy ()
   (interactive)
   (scala-indent:indent-line scala-indent:reluctant-strategy))
-        
+
 (defun scala-indent:scaladoc-indent (comment-start-pos)
   "Calculate indent for a multi-line comment. Scaladoc
 lines (starting with /**) are indented under the second
@@ -806,7 +806,7 @@ first asterisk.
 
 Note: start line is indented as code since the start of the
 comment is outside the comment region. "
-  (save-excursion 
+  (save-excursion
     (goto-char comment-start-pos)
     (when (looking-at "/\\*+")
       (goto-char
diff --git a/scala-mode-lib.el b/scala-mode-lib.el
index 2035cd4..2a0c932 100644
--- a/scala-mode-lib.el
+++ b/scala-mode-lib.el
@@ -4,7 +4,7 @@
 
 (provide 'scala-mode-lib)
 
-(defvar scala-mode:debug-messages 
+(defvar scala-mode:debug-messages
   "If true, some debug messages may be printed printed."
   nil)
 
@@ -22,5 +22,5 @@
   (save-excursion
     (end-of-line)
     (skip-syntax-backward " ")
-    (unless (bolp) 
+    (unless (bolp)
       (delete-char (- (line-end-position) (point))))))
diff --git a/scala-mode-map.el b/scala-mode-map.el
index edf6088..d827e41 100644
--- a/scala-mode-map.el
+++ b/scala-mode-map.el
@@ -7,7 +7,7 @@
 (require 'scala-mode-indent)
 
 (defmacro scala-mode-map:define-keys (key-map key-funcs)
-  (cons 'progn (mapcar 
+  (cons 'progn (mapcar
    #'(lambda (key-func)
        `(define-key ,key-map ,(car key-func) ,(cadr key-func)))
    key-funcs)))
@@ -25,10 +25,10 @@
 
 (when (not scala-mode-map)
   (let ((keymap (make-sparse-keymap)))
-    (scala-mode-map:define-keys 
+    (scala-mode-map:define-keys
      keymap
      (
 ;;      ([(control c)(control r)]   'scala-indent:rotate-run-on-strategy)
       ))
      (setq scala-mode-map keymap)))
-  
+
diff --git a/scala-mode-paragraph.el b/scala-mode-paragraph.el
index ef14e60..f059eb3 100644
--- a/scala-mode-paragraph.el
+++ b/scala-mode-paragraph.el
@@ -1,6 +1,6 @@
 ;;; scala-mode-paragraph.el - Major mode for editing scala, paragraph
 ;;; detection and fill
-;;; Copyright (c) 2012 Heikki Vesalainen For information on the License, 
+;;; Copyright (c) 2012 Heikki Vesalainen For information on the License,
 ;;; see the LICENSE file
 
 ;;; Based on Scala Language Specification (SLS) Version 2.9
@@ -42,7 +42,7 @@
           ))
 
 (defconst scala-paragraph:paragraph-separate-re
-  (concat scala-paragraph:paragraph-line-start-re 
+  (concat scala-paragraph:paragraph-line-start-re
           "\\(?:$"
           "\\|=[^=\n]+=[ ]*$"     ; heading 1
           "\\|==[^=\n]+==[ ]*$"   ; heading 2
@@ -62,13 +62,13 @@
         (widen)
         (beginning-of-line)
         (cond ((looking-at "\\s */?\\*+\\s *")
-               (setq fill (replace-regexp-in-string 
-                           "/\\*+" 
+               (setq fill (replace-regexp-in-string
+                           "/\\*+"
                            (lambda (str) (if (= (length str) 3) "  *" " *"))
                            (match-string-no-properties 0)))
                (goto-char (match-end 0))
                (when (looking-at scala-paragraph:scaladoc-list-start-re)
-                 (setq fill 
+                 (setq fill
                        (concat fill (make-string (- (match-end 0)
                                                     (match-beginning 0)) 
?\s)))))
               ((or (re-search-forward "\"\"\"|" (line-end-position) t)
@@ -77,7 +77,7 @@
                (setq fill (concat (make-string (- (current-column) 1) ?\s) 
"|"))
                (setq fill (concat fill (make-string (skip-syntax-forward " ") 
?\s)))
                (when (looking-at scala-paragraph:scaladoc-list-start-re)
-                 (setq fill 
+                 (setq fill
                        (concat fill (make-string (- (match-end 0)
                                                     (match-beginning 0)) 
?\s))))))))
     fill))
diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el
index 2fd9741..2524028 100644
--- a/scala-mode-syntax.el
+++ b/scala-mode-syntax.el
@@ -29,8 +29,8 @@
 (defconst scala-syntax:letter-group (concat scala-syntax:lower-group 
scala-syntax:upper-group)) ;; TODO: add Lt, Lo, Nl
 (defconst scala-syntax:digit-group "0-9")
 (defconst scala-syntax:letterOrDigit-group (concat
-                                            
scala-syntax:upperAndUnderscore-group 
-                                            scala-syntax:lower-group 
+                                            
scala-syntax:upperAndUnderscore-group
+                                            scala-syntax:lower-group
                                             scala-syntax:digit-group))
 (defconst scala-syntax:opchar-safe-group "!%&*+/?\\\\^|~-") ;; TODO: Sm, So
 (defconst scala-syntax:opchar-unsafe-group "#:<=>@")
@@ -43,8 +43,8 @@
 ;; Integer Literal (Chapter 1.3.1)
 (defconst scala-syntax:nonZeroDigit-group "1-9")
 (defconst scala-syntax:octalDigit-group "0-7")
-(defconst scala-syntax:decimalNumeral-re 
-  (concat "0" 
+(defconst scala-syntax:decimalNumeral-re
+  (concat "0"
           "\\|[" scala-syntax:nonZeroDigit-group "][" scala-syntax:digit-group 
"]*"))
 (defconst scala-syntax:hexNumeral-re (concat "0x[" scala-syntax:hexDigit-group 
"]+"))
 (defconst scala-syntax:octalNumeral-re (concat "0[" 
scala-syntax:octalDigit-group "]+"))
@@ -58,16 +58,16 @@
 ;; Floating Point Literal (Chapter 1.3.2)
 (defconst scala-syntax:exponentPart-re (concat "\\([eE][+-]?[" 
scala-syntax:digit-group "]+\\)"))
 (defconst scala-syntax:floatType-re "[fFdD]")
-(defconst scala-syntax:floatingPointLiteral-re 
+(defconst scala-syntax:floatingPointLiteral-re
   (concat "-?" ;; added from definition of literal
-          "\\([" scala-syntax:digit-group "]+\\.[" scala-syntax:digit-group 
"]*" 
+          "\\([" scala-syntax:digit-group "]+\\.[" scala-syntax:digit-group 
"]*"
           scala-syntax:exponentPart-re "?" scala-syntax:floatType-re "?"
-          "\\|" "\\.[" scala-syntax:digit-group "]+" 
+          "\\|" "\\.[" scala-syntax:digit-group "]+"
           scala-syntax:exponentPart-re "?" scala-syntax:floatType-re "?"
           "\\|" "[" scala-syntax:digit-group "]+" scala-syntax:exponentPart-re
           "\\|" "[" scala-syntax:digit-group "]+" scala-syntax:floatType-re 
"\\)"))
 
-(defconst scala-syntax:number-safe-start-re 
+(defconst scala-syntax:number-safe-start-re
   (concat "[^_" scala-syntax:letter-group "]"))
 
 ;; Boolean Literals (Chapter 1.3.3)
@@ -77,24 +77,24 @@
 (defconst scala-syntax:escapeSequence-re "\\\\['btnfr\"\\\\]")
 
 ;; Character Literals (Chapter 1.3.4)
-(defconst scala-syntax:characterLiteral-re 
+(defconst scala-syntax:characterLiteral-re
   (concat "\\('\\)\\(" "[^\\\\]" ;; should be just printable char, but this is 
faster
           "\\|" scala-syntax:escapeSequence-re
           "\\|" scala-syntax:UnicodeEscape-re "\\)\\('\\)"))
 
 (defconst scala-syntax:string-escape-re
-  (concat scala-syntax:escapeSequence-re 
+  (concat scala-syntax:escapeSequence-re
           "\\|" scala-syntax:UnicodeEscape-re))
 
 ;; String Literals (Chapter 1.3.5)
 (defconst scala-syntax:stringElement-re
-  (concat "\\(" "[^\n\"\\\\]" 
+  (concat "\\(" "[^\n\"\\\\]"
           "\\|" scala-syntax:string-escape-re  "\\)"))
 (defconst scala-syntax:oneLineStringLiteral-re (concat "\\(\"\\)" 
scala-syntax:stringElement-re "*\\(\"\\)"))
 (defconst scala-syntax:multiLineStringLiteral-re
   "\\(\"\\)\\(\"\"\\(\"?\"?[^\"]\\)*\"\"+\\)\\(\"\\)")
 (defconst scala-syntax:stringLiteral-re
-  (concat "\\(" scala-syntax:multiLineStringLiteral-re 
+  (concat "\\(" scala-syntax:multiLineStringLiteral-re
           "\\|" scala-syntax:oneLineStringLiteral-re "\\)" ))
 
 ;; If you change this or any of the used regex, be sure to
@@ -103,14 +103,14 @@
 ;; group 4 = multi-line string start, 7 = end
 ;; group 8 = string start, 11 = end
 (defconst scala-syntax:relaxed-char-and-string-literal-re
-  (concat scala-syntax:characterLiteral-re 
+  (concat scala-syntax:characterLiteral-re
           "\\|" scala-syntax:multiLineStringLiteral-re
           "\\|\\(\"\\)" "\\(\\\\.\\|[^\"\n\\]\\)*" "\\(\"\\)"))
 
 ;; Identifiers (Chapter 1.1)
-(defconst scala-syntax:op-re 
+(defconst scala-syntax:op-re
   (concat "[" scala-syntax:opchar-group "]+" ))
-(defconst scala-syntax:idrest-re 
+(defconst scala-syntax:idrest-re
   ;; Eagerness of regexp causes problems with _. The following is a workaround,
   ;; but the resulting regexp matches only what SLS demands.
   (concat "\\(" "[_]??" "[" scala-syntax:letter-group scala-syntax:digit-group 
"]+" "\\)*"
@@ -121,13 +121,13 @@
                                           "\\|" scala-syntax:op-re "\\)"))
 ;; stringlit is referred to, but not defined Scala Language Specification 2.9
 ;; we define it as consisting of anything but '`' and newline
-(defconst scala-syntax:stringlit-re "[^`\n\r]") 
+(defconst scala-syntax:stringlit-re "[^`\n\r]")
 (defconst scala-syntax:quotedid-re (concat "`" scala-syntax:stringlit-re "`"))
-(defconst scala-syntax:id-re (concat "\\(" scala-syntax:plainid-re 
+(defconst scala-syntax:id-re (concat "\\(" scala-syntax:plainid-re
                               "\\|" scala-syntax:quotedid-re "\\)"))
 (defconst scala-syntax:id-first-char-group
-  (concat scala-syntax:lower-group 
-          scala-syntax:upperAndUnderscore-group 
+  (concat scala-syntax:lower-group
+          scala-syntax:upperAndUnderscore-group
           scala-syntax:opchar-group))
 
 ;; Symbol literals (Chapter 1.3.7)
@@ -141,17 +141,17 @@
           "\\|" scala-syntax:floatingPointLiteral-re
           "\\|" scala-syntax:booleanLiteral-re
           "\\|" scala-syntax:characterLiteral-re
-          "\\|" scala-syntax:stringLiteral-re 
-          "\\|" scala-syntax:symbolLiteral-re 
+          "\\|" scala-syntax:stringLiteral-re
+          "\\|" scala-syntax:symbolLiteral-re
           "\\|" "null" "\\)"))
 
 ;; Paths (Chapter 3.1)
 ;; emacs has a problem with these regex, don't use them
 ;; (defconst scala-syntax:classQualifier-re (concat "[[]" scala-syntax:id-re 
"[]]"))
-;; (defconst scala-syntax:stableId-re 
+;; (defconst scala-syntax:stableId-re
 ;;   (concat "\\(\\(" "this"
-;;           "\\|" "super" scala-syntax:classQualifier-re 
-;;           "\\|" scala-syntax:id-re 
+;;           "\\|" "super" scala-syntax:classQualifier-re
+;;           "\\|" scala-syntax:id-re
 ;;           "\\)\\.\\)*"
 ;;           scala-syntax:id-re))
 ;; (defconst scala-syntax:path-re
@@ -183,7 +183,7 @@
           (set-match-data `(,beg ,(match-end 0)))
           t)))))
 
-(defun scala-syntax:looking-at-stableIdOrPath (&optional path-p beg) 
+(defun scala-syntax:looking-at-stableIdOrPath (&optional path-p beg)
   (unless beg (setq beg (point)))
   (save-excursion
     (cond ((looking-at "\\<this\\>")
@@ -212,7 +212,7 @@
 ;;; Other regular expressions
 ;;;
 
-(defconst scala-syntax:empty-line-re  
+(defconst scala-syntax:empty-line-re
   "^\\s *$")
 
 (defconst scala-syntax:comment-start-re
@@ -237,17 +237,17 @@
   (concat "\\(^\\|[^`]\\)\\(" scala-syntax:value-keywords-unsafe-re "\\)"))
 
 (defconst scala-syntax:other-keywords-unsafe-re
-  (regexp-opt '("abstract" "case" "catch" "class" "def" "do" "else" "extends" 
-                "final" "finally" "for" "forSome" "if" "implicit" "import" 
-                "lazy" "match" "new" "object" "override" "package" "private" 
-                "protected" "return" "sealed" "throw" "trait" "try" "type" 
+  (regexp-opt '("abstract" "case" "catch" "class" "def" "do" "else" "extends"
+                "final" "finally" "for" "forSome" "if" "implicit" "import"
+                "lazy" "match" "new" "object" "override" "package" "private"
+                "protected" "return" "sealed" "throw" "trait" "try" "type"
                 "val" "var" "while" "with" "yield") 'words))
 
 (defconst scala-syntax:other-keywords-re
   (concat "\\(^\\|[^`]\\)\\(" scala-syntax:other-keywords-unsafe-re "\\)"))
 
 (defconst scala-syntax:keywords-unsafe-re
-  (concat "\\(" scala-syntax:path-keywords-unsafe-re 
+  (concat "\\(" scala-syntax:path-keywords-unsafe-re
           "\\|" scala-syntax:value-keywords-unsafe-re
           "\\|" scala-syntax:other-keywords-unsafe-re
           "\\)"))
@@ -260,7 +260,7 @@
 
 
 (defconst scala-syntax:after-reserved-symbol-underscore-re
-  (concat "$\\|" scala-syntax:comment-start-re 
+  (concat "$\\|" scala-syntax:comment-start-re
           "\\|[^" scala-syntax:letterOrDigit-group "]"))
 
 (defconst scala-syntax:reserved-symbol-underscore-re
@@ -278,26 +278,26 @@
   "\\(=>\\|\u21D2\\)")
 
 (defconst scala-syntax:after-reserved-symbol-re
-  (concat "\\($\\|" scala-syntax:comment-start-re 
+  (concat "\\($\\|" scala-syntax:comment-start-re
           "\\|[^" scala-syntax:opchar-group "]\\)"))
 
 (defconst scala-syntax:reserved-symbols-re
   ;; reserved symbols and XML starts ('<!' and '<?')
-  (concat "\\(^\\|[^" scala-syntax:opchar-group "]\\)" 
+  (concat "\\(^\\|[^" scala-syntax:opchar-group "]\\)"
           scala-syntax:reserved-symbols-unsafe-re
           "\\(" scala-syntax:after-reserved-symbol-re "\\)"))
 
 (defconst scala-syntax:colon-re
-  (concat "\\(^\\|[^" scala-syntax:opchar-group "]\\)" 
+  (concat "\\(^\\|[^" scala-syntax:opchar-group "]\\)"
           "\\(:\\)"
           "\\(" scala-syntax:after-reserved-symbol-re "\\)"))
 
 
 (defconst scala-syntax:modifiers-re
-  (regexp-opt '("override" "abstract" "final" "sealed" "implicit" "lazy" 
+  (regexp-opt '("override" "abstract" "final" "sealed" "implicit" "lazy"
                 "private" "protected") 'words))
 
-(defconst scala-syntax:body-start-re 
+(defconst scala-syntax:body-start-re
   (concat "=" scala-syntax:end-of-code-line-re)
   "A regexp for detecting if a line ends with '='")
 
@@ -308,7 +308,7 @@
 (defconst scala-syntax:multiLineStringLiteral-start-re
   "\\(\"\\)\"\"")
 
-(defconst scala-syntax:multiLineStringLiteral-end-re 
+(defconst scala-syntax:multiLineStringLiteral-end-re
   "\"\"+\\(\"\\)")
 
 (defconst scala-syntax:case-re
@@ -337,7 +337,7 @@
     ;; parentheses, so all others marked as parentheses in the parent
     ;; table must be marked as symbols, nothing is a punctuation
     ;; unless otherwise stated
-    (map-char-table 
+    (map-char-table
      #'(lambda (key value)
          (when (or (= (syntax-class value) 4) ; open
                    (= (syntax-class value) 5) ; close
@@ -370,7 +370,7 @@
 
     ;; for clarity, the \ is alone here and not in the string above
     (modify-syntax-entry ?\\ "." syntab)
-  
+
     ;; scala strings cannot span lines, so we mark
     ;; " as punctuation, but do the real stuff
     ;; in syntax-propertize-function for properly
@@ -399,7 +399,7 @@
     (modify-syntax-entry ?\*  ". 23n"   syntab)
     (modify-syntax-entry ?\n  "> b" syntab)
     (modify-syntax-entry ?\r  "> b" syntab)
-    
+
     (setq scala-syntax:syntax-table syntab)))
 
 (defun scala-syntax:propertize-extend-region (start end)
@@ -410,9 +410,9 @@
 (defmacro scala-syntax:put-syntax-table-property (match-group value)
   "Add 'syntax-table entry 'value' to the region marked by the
 match-group 'match-group'"
-  `(put-text-property (match-beginning ,match-group) 
-                      (match-end ,match-group) 
-                      'syntax-table 
+  `(put-text-property (match-beginning ,match-group)
+                      (match-end ,match-group)
+                      'syntax-table
                       ,value))
 
 (defun scala-syntax:propertize-char-and-string-literals (start end)
@@ -423,11 +423,11 @@ marked with 15 (generic string delimiter). Multi-line 
string
 literals are marked even if they are unbalanced. One-line string
 literals have to be balanced to get marked. This means invalid
 characters and one-line strings will not be fontified."
-        
+
   (let* ((string-state (nth 3 (syntax-ppss start)))
          (unbalanced-p (eq string-state t)))
 
-    (if (and string-state (not unbalanced-p)) 
+    (if (and string-state (not unbalanced-p))
         ;; a normal string is open, let's de-propertize
         (remove-text-properties start end '(syntax-table nil))
       (save-excursion
@@ -438,7 +438,7 @@ characters and one-line strings will not be fontified."
           (scala-syntax:put-syntax-table-property 1 '(15 . nil)))
         ;; match any balanced one-line or multi-line literals
         (catch 'break
-          (while (re-search-forward 
+          (while (re-search-forward
                   scala-syntax:relaxed-char-and-string-literal-re end t)
             ;; Expects the following groups:
             ;; group 1 = char start, 3 = char end
@@ -451,11 +451,11 @@ characters and one-line strings will not be fontified."
              ((match-beginning 4) ;; balanced multi-line literal
               (scala-syntax:put-syntax-table-property 4 '(15 . nil))
               (scala-syntax:put-syntax-table-property 7 '(15 . nil)))
-             ((or  
+             ((or
                ;; normal string, content is not empty
-               (match-beginning 9) 
+               (match-beginning 9)
                ;; empty string at line end
-               (= (match-end 10) (line-end-position)) 
+               (= (match-end 10) (line-end-position))
                ;; no " after empty string
                (not (= (char-after (match-end 10)) ?\")))
               (when (save-excursion
@@ -480,7 +480,7 @@ symbol constituents (syntax 3)"
     (while (re-search-forward "_" end t)
       (let ((match-beg (match-beginning 0))
             (match-end (match-end 0)))
-        (put-text-property 
+        (put-text-property
          match-beg match-end 'syntax-table
          (if (= match-beg (line-beginning-position))
              (if (looking-at scala-syntax:after-reserved-symbol-underscore-re)
@@ -498,7 +498,7 @@ symbol constituents (syntax 3)"
 
 
 (defun scala-syntax:propertize (start end)
-  "See syntax-propertize-function" 
+  "See syntax-propertize-function"
   (scala-syntax:propertize-char-and-string-literals start end)
   (scala-syntax:propertize-underscore-and-idrest start end))
 
@@ -577,7 +577,7 @@ stableId"
          (looking-at-p scala-syntax:empty-line-re))))
 
 (defun scala-syntax:skip-forward-ignorable ()
-  "Moves forward over ignorable whitespace and comments. A 
+  "Moves forward over ignorable whitespace and comments. A
 completely empty line is not ignorable and will not be mobed over."
   (interactive)
   (save-match-data
@@ -659,7 +659,7 @@ one."
 (defun scala-syntax:newlines-disabled-p (&optional point)
   "Return true if newlines are disabled at the current point (or
 point 'point') as specified by SLS chapter 1.2"
-  ;; newlines are disabled if 
+  ;; newlines are disabled if
   ;; - in '()' or '[]'
   ;; - between 'case' and '=>'
   ;; - XML mode (not implemented here)
@@ -669,9 +669,9 @@ point 'point') as specified by SLS chapter 1.2"
            (parenthesisPos (nth 1 state)))
       (when parenthesisPos ;; if no parenthesis, then this cannot be a case 
block either
         (goto-char parenthesisPos)
-        (or 
+        (or
          ;; the trivial cases of being inside ( or [
-         (= (char-after) ?\() 
+         (= (char-after) ?\()
          (= (char-after) ?\[)
          ;; else we have to see about case
          (progn
@@ -693,7 +693,7 @@ point 'point') as specified by SLS chapter 1.2"
                (unless (scala-syntax:looking-at-reserved-symbol
                         scala-syntax:double-arrow-unsafe-re)
                  (scala-syntax:forward-sexp)
-                 
+
                  (and (<= (point) point) ;; check that we were inside in the 
first place
                       (progn (scala-syntax:skip-forward-ignorable)
                              (not (looking-at 
scala-syntax:class-or-object-re)))))))))))))
@@ -714,11 +714,11 @@ beginning of the skipped expression."
   (while (< 0 (+ (skip-syntax-forward " ")
                  (skip-chars-forward scala-syntax:delimiter-group))))
 
-  ;; emacs can handle everything but opchars  
+  ;; emacs can handle everything but opchars
   (when (= (skip-syntax-forward ".") 0)
     (goto-char (or (scan-sexps (point) 1) (buffer-end 1)))))
-    
-(defun scala-syntax:backward-sexp () 
+
+(defun scala-syntax:backward-sexp ()
   "Move backward one scala expression. It can be: parameter
   list (value or type), id, reserved symbol, keyword, block, or
   literal. Delimiters (.,;) and comments are skipped
@@ -729,11 +729,11 @@ beginning of the skipped expression."
   (forward-comment (- (buffer-size)))
   (while (> 0 (+ (skip-syntax-backward " ")
                  (skip-chars-backward scala-syntax:delimiter-group))))
-  
+
   (when (= (skip-syntax-backward ".") 0)
     (goto-char (or (scan-sexps (point) -1) (buffer-end -1)))
-    (backward-prefix-chars)))   
-    
+    (backward-prefix-chars)))
+
 (defun scala-syntax:has-char-before (char end)
   (save-excursion
     (while (and (< (point) end)
@@ -748,7 +748,7 @@ beginning of the skipped expression."
   "Searches backward sexps until it reaches re, empty line or ;.
 If re is found, point is set to beginning of re and the position
 is returned, otherwise nil is returned"
-  (let ((found (save-excursion 
+  (let ((found (save-excursion
                  (while (not (or (bobp)
                                  (scala-syntax:looking-back-empty-line-p)
                                  (scala-syntax:looking-back-token "[;,]")
@@ -758,7 +758,7 @@ is returned, otherwise nil is returned"
                      (point)
                    nil))))
     (when found (goto-char found))))
-              
+
 (defun scala-syntax:list-p (&optional point)
   "Returns the start of the list, if the current point (or point
 'point') is on the first line of a list element > 1, or nil if
diff --git a/scala-mode.el b/scala-mode.el
index 8731d38..bfb3f6f 100644
--- a/scala-mode.el
+++ b/scala-mode.el
@@ -16,7 +16,7 @@
 ;; Tested only for emacs 24
 (unless (<= 24 emacs-major-version)
   (error
-   (format "The Scala mode has been tested only on Emacs version 24.2 (and not 
your Emacs version %s.%s)"  
+   (format "The Scala mode has been tested only on Emacs version 24.2 (and not 
your Emacs version %s.%s)"
            emacs-major-version  emacs-minor-version)))
 
 (defgroup scala nil
@@ -39,11 +39,11 @@
 (define-derived-mode scala-mode prog-mode "Scala"
   "Major mode for editing scala code.
 
-When started, runs `scala-mode-hook'. 
+When started, runs `scala-mode-hook'.
 
-\\{scala-mode-map}" 
+\\{scala-mode-map}"
   :syntax-table scala-syntax:syntax-table
-;  :group                               
+;  :group
 ;  :abbrev
 
   (scala-mode:make-local-variables



reply via email to

[Prev in Thread] Current Thread [Next in Thread]