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

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

[elpa] externals/phps-mode c68c7a0 131/405: Fixed issue were first-token


From: Stefan Monnier
Subject: [elpa] externals/phps-mode c68c7a0 131/405: Fixed issue were first-token-on-line was nil
Date: Sat, 13 Jul 2019 09:59:59 -0400 (EDT)

branch: externals/phps-mode
commit c68c7a000217b3fef04e6dc573c505b9ac25361a
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>

    Fixed issue were first-token-on-line was nil
---
 phps-mode-functions.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index ba99fa2..088d31b 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -323,14 +323,14 @@
                            (<= token-start line-end))
                   (setq first-token-on-line end-token-number))
 
-
                 ;; Did we encounter end of alternative control structure?
                 (when (or (equal token 'T_ENDIF)
                           (equal token 'T_ENDWHILE)
                           (equal token 'T_ENDFOR)
                           (equal token 'T_ENDFOREACH)
                           (equal token 'T_ENDSWITCH))
-                  (when (= first-token-on-line end-token-number)
+                  (when (and first-token-on-line
+                             (= first-token-on-line end-token-number))
                     (setq start-alternative-control-structure-level (1- 
start-alternative-control-structure-level)))
                   (setq end-alternative-control-structure-level (1- 
end-alternative-control-structure-level)))
 
@@ -365,7 +365,8 @@
 
                         ;; Is token at or before line beginning?
                         (when (or (<= token-end line-beginning)
-                                  (= first-token-on-line end-token-number))
+                                  (and first-token-on-line
+                                       (= first-token-on-line 
end-token-number)))
                           (setq start-alternative-control-structure-level (1+ 
start-alternative-control-structure-level)))
 
                         ;; Is token at or before line end?
@@ -375,7 +376,8 @@
                         )
 
                     (when (or (<= token-end line-beginning)
-                              (= first-token-on-line end-token-number))
+                              (and first-token-on-line
+                                   (= first-token-on-line end-token-number)))
                       (setq start-inline-control-structure-level (1+ 
start-inline-control-structure-level))
                       (setq start-expecting-semi-colon t))
 



reply via email to

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