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

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

[nongnu] elpa/dart-mode 3c089f3 183/192: Fix font lock for abstract meth


From: ELPA Syncer
Subject: [nongnu] elpa/dart-mode 3c089f3 183/192: Fix font lock for abstract method
Date: Sun, 29 Aug 2021 11:02:14 -0400 (EDT)

branch: elpa/dart-mode
commit 3c089f3b2d710abd2a23c0bab13b9508ce585411
Author: Brady Trainor <mail@bradyt.net>
Commit: Brady Trainor <mail@bradyt.net>

    Fix font lock for abstract method
---
 dart-mode.el | 53 ++++++++++++++++++++++++-----------------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/dart-mode.el b/dart-mode.el
index 0923fcb..7ed7855 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -279,35 +279,30 @@ For example, \"compareTo\" in \"  int compareTo(num 
other);\" would be
 matched."
   (catch 'result
     (let (beg end)
-      (while (re-search-forward
-              (rx (group (eval (dart--identifier 'lower))) ?\() limit t)
-        (setq beg (match-beginning 1))
-        (setq end (match-end 1))
-        (condition-case nil
-            (progn
-              (up-list)
-              (when (> (point) limit)
-                (throw 'result nil))
-              (unless (= (char-after (point)) ?\;)
-                (throw 'result nil))
-              (goto-char beg)
-              (back-to-indentation)
-              (unless (= (current-column) 2)
-                (throw 'result nil))
-              (unless (string-match-p
-                     " " (buffer-substring-no-properties
-                          (point) beg))
-                (throw 'result nil))
-              (when (string-match-p
-                     "=" (buffer-substring-no-properties
-                          (point) beg))
-                (throw 'result nil))
-              (goto-char end)
-              (set-match-data (list beg end))
-              (throw 'result t))
-          (scan-error nil))
-        (goto-char end))
-      (throw 'result nil))))
+        (while (re-search-forward
+                (rx (group (eval (dart--identifier 'lower))) ?\() limit t)
+          (setq beg (match-beginning 1))
+          (setq end (match-end 1))
+          (condition-case nil
+              (progn
+                (up-list)
+                (when (and (< (point) (point-max))
+                           (= (char-after (point)) ?\;))
+                  (goto-char beg)
+                  (back-to-indentation)
+                  (when (and (= (current-column) 2)
+                             (string-match-p
+                              " " (buffer-substring-no-properties
+                                   (point) beg))
+                             (not (string-match-p
+                                   "=" (buffer-substring-no-properties
+                                        (point) beg))))
+                    (goto-char end)
+                    (set-match-data (list beg end))
+                    (throw 'result t))))
+            (scan-error nil))
+          (goto-char end)))
+    (throw 'result nil)))
 
 (defun dart--declared-identifier-func (limit)
   "Font-lock matcher function for declared identifiers.



reply via email to

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