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

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

[elpa] externals/phps-mode 7161184 041/405: Handles stacked states bette


From: Stefan Monnier
Subject: [elpa] externals/phps-mode 7161184 041/405: Handles stacked states better
Date: Sat, 13 Jul 2019 09:59:39 -0400 (EDT)

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

    Handles stacked states better
---
 phps-lexer.el | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/phps-lexer.el b/phps-lexer.el
index 8fb5694..2a2c9d1 100644
--- a/phps-lexer.el
+++ b/phps-lexer.el
@@ -169,17 +169,11 @@
   )
 
 ;; _yy_push_state
-(defun phps-mode/yy_push_state (state)
-  "Add STATE to stack and then begin state."
-  (let ((old-state (car phps-mode/state_stack)))
-    (when (not old-state)
-      (setq old-state phps-mode/STATE))
-    (if (not phps-mode/state_stack)
-        (setq phps-mode/state_stack (list old-state))
-      (push old-state phps-mode/state_stack))
-    ;; (message "Added state %s to stack" old-state)
-    )
-  (phps-mode/BEGIN state))
+(defun phps-mode/yy_push_state (new-state)
+  "Add NEW-STATE to stack and then begin state."
+  (push phps-mode/STATE phps-mode/state_stack)
+  ;; (message "Added state %s to stack" old-state)
+  (phps-mode/BEGIN new-state))
 
 (defun phps-mode/yy_pop_state ()
   "Pop current state from stack."



reply via email to

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