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

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

[elpa] externals/phps-mode e0389c235f 6/8: Using separate error catching


From: Christian Johansson
Subject: [elpa] externals/phps-mode e0389c235f 6/8: Using separate error catching for imenu and bookkeeping generation
Date: Wed, 23 Mar 2022 12:27:10 -0400 (EDT)

branch: externals/phps-mode
commit e0389c235f78ab0e02162b1b222688c5da936616
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Using separate error catching for imenu and bookkeeping generation
---
 phps-mode-lex-analyzer.el | 62 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 40 insertions(+), 22 deletions(-)

diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 6b424677e9..010d4b2098 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -251,21 +251,30 @@
            (setq phps-mode-lex-analyzer--parse-error (nth 8 lex-result))
            (setq phps-mode-lex-analyzer--ast (nth 9 lex-result))
 
-           ;; Catch errors in bookkeeping or imenu generation
+           ;; Catch errors in bookkeeping generation
            (condition-case conditions
-               (progn
-                 (phps-mode-ast-bookkeeping--generate
-                  phps-mode-lex-analyzer--ast)
-                 (phps-mode-ast-imenu--generate
-                  phps-mode-lex-analyzer--ast))
+               (phps-mode-ast-bookkeeping--generate
+                phps-mode-lex-analyzer--ast)
              (error
               (display-warning
-              'phps-mode
-              (format "Failed to generate bookkeeping or imenu: %S" conditions)
-              :warning
-              "*PHPs Parser Errors*")))
+               'phps-mode
+               (format "Failed to generate bookkeeping: %S" conditions)
+               :warning
+               "*PHPs Bookkeeping Generation Errors*")))
+           (setq phps-mode-lex-analyzer--bookkeeping
+                 phps-mode-ast-bookkeeping--index)
+
+           ;; Catch errors in imenu generation
+           (condition-case conditions
+               (phps-mode-ast-imenu--generate
+                phps-mode-lex-analyzer--ast)
+             (error
+              (display-warning
+               'phps-mode
+               (format "Failed to generate imenu: %S" conditions)
+               :warning
+               "*PHPs Imenu Generation Errors*")))
            (setq phps-mode-lex-analyzer--imenu phps-mode-ast-imenu--index)
-           (setq phps-mode-lex-analyzer--bookkeeping 
phps-mode-ast-bookkeeping--index)
 
            (setq phps-mode-lex-analyzer--processed-buffer-p t)
            (phps-mode-lex-analyzer--reset-imenu)
@@ -404,21 +413,30 @@
            (setq phps-mode-lex-analyzer--parse-error (nth 8 lex-result))
            (setq phps-mode-lex-analyzer--ast (nth 9 lex-result))
 
-           ;; Catch errors in bookkeeping or imenu generation
+           ;; Catch errors in bookkeeping generation
            (condition-case conditions
-               (progn
-                 (phps-mode-ast-bookkeeping--generate
-                  phps-mode-lex-analyzer--ast)
-                 (phps-mode-ast-imenu--generate
-                  phps-mode-lex-analyzer--ast))
+               (phps-mode-ast-bookkeeping--generate
+                phps-mode-lex-analyzer--ast)
              (error
               (display-warning
-              'phps-mode
-              (format "Failed to generate bookkeeping or imenu: %S" conditions)
-              :warning
-              "*PHPs Parser Errors*")))
+               'phps-mode
+               (format "Failed to generate bookkeeping: %S" conditions)
+               :warning
+               "*PHPs Bookkeeping Generation Errors*")))
+           (setq phps-mode-lex-analyzer--bookkeeping
+                 phps-mode-ast-bookkeeping--index)
+
+           ;; Catch errors in imenu generation
+           (condition-case conditions
+               (phps-mode-ast-imenu--generate
+                phps-mode-lex-analyzer--ast)
+             (error
+              (display-warning
+               'phps-mode
+               (format "Failed to generate imenu: %S" conditions)
+               :warning
+               "*PHPs Imenu Generation Errors*")))
            (setq phps-mode-lex-analyzer--imenu phps-mode-ast-imenu--index)
-           (setq phps-mode-lex-analyzer--bookkeeping 
phps-mode-ast-bookkeeping--index)
 
            (phps-mode-debug-message
             (message "Incremental tokens: %s" phps-mode-lex-analyzer--tokens))



reply via email to

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