branch: externals/phps-mode
commit 7161184dfe6e001481649e7b689c50db113177dd
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
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."