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

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

[elpa] externals/javaimp 53146a24d9: Use javaimp-parse--skip-back-until


From: Filipp Gunbin
Subject: [elpa] externals/javaimp 53146a24d9: Use javaimp-parse--skip-back-until for exiting comments/strings
Date: Fri, 13 May 2022 19:36:00 -0400 (EDT)

branch: externals/javaimp
commit 53146a24d910ae19122dbace68c3a4dfff1b13ac
Author: Filipp Gunbin <fgunbin@fastmail.fm>
Commit: Filipp Gunbin <fgunbin@fastmail.fm>

    Use javaimp-parse--skip-back-until for exiting comments/strings
---
 javaimp-parse.el | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/javaimp-parse.el b/javaimp-parse.el
index 0e1cb1350e..61d14910e8 100644
--- a/javaimp-parse.el
+++ b/javaimp-parse.el
@@ -257,12 +257,8 @@ point (but not farther than BOUND).  Matches inside 
comments /
 strings are skipped.  Return the beginning of the match (then the
 point is also at that position) or nil (then the point is left
 unchanged)."
-  (let ((state (syntax-ppss))
-        prev-semi pos res)
-    ;; Move out of any comment/string
-    (when (nth 8 state)
-      (goto-char (nth 8 state))
-      (setq state (syntax-ppss)))
+  (let (prev-semi pos res)
+    (javaimp-parse--skip-back-until)
     ;; If we skip a previous scope (including unnamed initializers),
     ;; or reach enclosing scope start, we'll fail the check in the
     ;; below loop.  But a semicolon, which delimits statements, will
@@ -573,12 +569,9 @@ call this function first."
 
 (defun javaimp-parse--enclosing-scope (&optional pred)
   "Return innermost enclosing scope matching PRED."
-  (let ((state (syntax-ppss)))
-    ;; Move out of any comment/string
-    (when (nth 8 state)
-      (goto-char (nth 8 state))
-      (setq state (syntax-ppss)))
-    (catch 'found
+  (javaimp-parse--skip-back-until)
+  (catch 'found
+    (let ((state (syntax-ppss)))
       (while t
         (let ((res (save-excursion
                      (javaimp-parse--scopes nil))))



reply via email to

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