[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the slow regexp, not faster |
Date: |
Sun, 29 Aug 2021 11:30:38 -0400 (EDT) |
branch: elpa/scala-mode
commit fe5c2c41131dc64c50930713e0abbd96370f2f30
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Fixes #11: was still using the slow regexp, not faster
---
scala-mode-fontlock.el | 15 +++++++++------
scala-mode-syntax.el | 31 ++++++++++++++-----------------
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/scala-mode-fontlock.el b/scala-mode-fontlock.el
index 3e3bbfd..df62187 100644
--- a/scala-mode-fontlock.el
+++ b/scala-mode-fontlock.el
@@ -35,10 +35,11 @@ scala-mode has been reloaded."
(while (and (not (or (eobp)
(looking-at scala-syntax:other-keywords-unsafe-re)
(scala-syntax:looking-at-reserved-symbol nil)))
- (looking-at scala-syntax:simplePattern-beginning-re))
+ (scala-syntax:looking-at-simplePattern-beginning))
; (message "- now at %d" (point))
(if (= (char-after) ?\()
(forward-list)
+ ;; else
(goto-char (match-end 0))
(scala-syntax:skip-forward-ignorable)
; (message "+ now at %d" (point))
@@ -48,20 +49,22 @@ scala-mode has been reloaded."
(goto-char (match-end 0)))
((or (scala-syntax:looking-at-reserved-symbol nil)
(looking-at scala-syntax:other-keywords-unsafe-re))
- (messssage "saw reserved symbol or keyword"))
+; (messssage "saw reserved symbol or keyword"))
((looking-at scala-syntax:id-re)
; (message "saw id-re %d" (match-beginning 0))
(goto-char (match-end 0)))
; (t
; (message "nothing special here %s" (point)))
- ))
+ )))
(scala-syntax:skip-forward-ignorable)))
+; (message "limit at %s" (point))
(point)))
(defun scala-font-lock:limit-pattern2-list (&optional start)
(let ((limit (scala-font-lock:limit-pattern2 start)))
(while (= (char-after limit) ?,)
(setq limit (scala-font-lock:limit-pattern2 (1+ limit))))
+; (message "list limit at %s" limit)
limit))
(defun scala-font-lock:mark-pattern1-part (&optional limit pattern-p)
@@ -84,7 +87,7 @@ Does not continue past limit.
;; quit if we are past limit
((or (and limit (>= (point) limit))
(eobp))
-; (message "limit")
+; (message "at limit %s" (point))
nil)
;; Type pattern, just skip the whole thing. It will end at ',' or ')'.
;; Note: forms starting with ':' are handled by a completely separete
@@ -183,9 +186,9 @@ Does not continue past limit.
(set-match-data nil)
t)
;; none of the above, just stop
-; (t
+ (t
; (message "Cannot continue Pattern1 at %d" (point))
-; nil)
+ nil)
))
(defun scala-font-lock:limit-pattern (&optional start)
diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el
index d42f21a..665741a 100644
--- a/scala-mode-syntax.el
+++ b/scala-mode-syntax.el
@@ -139,17 +139,16 @@
;; 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
- (concat "\\(\\(" "this"
- "\\|" "super" scala-syntax:classQualifier-re
- "\\|" scala-syntax:id-re
- "\\)\\.\\)*"
- scala-syntax:id-re))
-(defconst scala-syntax:path-re
- (concat "\\(" scala-syntax:stableId-re
- "\\|" "\\(" scala-syntax:id-re "\\." "\\)?" "this" "\\)"))
-
+;; (defconst scala-syntax:classQualifier-re (concat "[[]" scala-syntax:id-re
"[]]"))
+;; (defconst scala-syntax:stableId-re
+;; (concat "\\(\\(" "this"
+;; "\\|" "super" scala-syntax:classQualifier-re
+;; "\\|" scala-syntax:id-re
+;; "\\)\\.\\)*"
+;; scala-syntax:id-re))
+;; (defconst scala-syntax:path-re
+;; (concat "\\(" scala-syntax:stableId-re
+;; "\\|" "\\(" scala-syntax:id-re "\\." "\\)?" "this" "\\)"))
(defun scala-syntax:looking-at-super ()
(save-excursion
@@ -196,12 +195,10 @@
(set-match-data `(,beg ,(match-end 0)))
(point))))))
-;; Patterns
-(defconst scala-syntax:simplePattern-beginning-re
- (concat "\\([_(]"
- "\\|" scala-syntax:literal-re
- "\\|" scala-syntax:stableId-re
- "\\)"))
+(defun scala-syntax:looking-at-simplePattern-beginning ()
+ (or (looking-at "[_(]")
+ (looking-at scala-syntax:literal-re)
+ (scala-syntax:looking-at-stableIdOrPath)))
;;;
;;; Other regular expressions
- [nongnu] elpa/scala-mode ed645d2 153/217: move create index function for imenu to big setq with everything else., (continued)
- [nongnu] elpa/scala-mode ed645d2 153/217: move create index function for imenu to big setq with everything else., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 618f0fb 163/217: remove 'scala-indent:indent-on-parentheses in preference of smartparens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 56cba29 194/217: Fix bad syntax when `*/` is prefixed by an opcode. (#143), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a1ff6f3 202/217: feat: add Scala 3 keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 46bb948 198/217: Fix #155, remove ob-scala.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a2a1b1d 208/217: compile mode with sbt thin client, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 54fa36f 200/217: Merge pull request #159 from kpbochenek/fix-files-association-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5058a85 204/217: doc: clarify Scala versions supported, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0c5ed9e 022/217: deleted example files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the slow regexp, not faster,
ELPA Syncer <=
- [nongnu] elpa/scala-mode 1a3d958 029/217: forward/backward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e30b35a 008/217: Indentation working, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 59cdd94 074/217: Add `scala-indent:use-javadoc-style` defcustom., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 347faeb 075/217: Add Evan Meagher to contributors list., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 081a92b 081/217: scala-indent:remove-indent-from-previous-empty-line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0fac9ae 014/217: removed debug messages, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9476d4c 018/217: Fixes #3: alignment of else inside parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3f724ed 030/217: Add the scala-indent:pad-equals setting., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6257e3b 033/217: Renamed bad-equals to indent-value-expression. Added info to README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4e3a24f 043/217: Updated Examples.md to reflect issues already solved, ELPA Syncer, 2021/08/29