branch: externals/phps-mode
commit e50ecb53bed4dc3f6a419b1e930130f8a1d41d65
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
More debugging byte-compilation issue
---
phps-mode-lexer.el | 29 +++++++++++++++++++++++------
phps-mode-macros.el | 2 +-
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index 918fcd30d9..a5d2184729 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -2056,18 +2056,35 @@
(gethash
phps-mode-lexer--state
phps-mode-lexer--lambdas-by-state)))
- (dolist (lambd lambdas)
- (funcall lambd)))
-
- (when (fboundp 'thread-yield)
- (thread-yield))
+ (let ((lambda-i 0)
+ (lambda-length (length lambdas)))
+ (phps-mode-debug-message
+ (message "Found %d lexer rules in state" lambda-length))
+ (while (< lambda-i lambda-length)
+ (let ((lambd (nth lambda-i lambdas)))
+ (let ((old-match-length phps-mode-lexer--match-length))
+ (funcall lambd)
+
+ ;; Debug new matches
+ (phps-mode-debug-message
+ (when (and
+ old-match-length
+ (> phps-mode-lexer--match-length old-match-length))
+ (message
+ "Found new match (%d) %s"
+ phps-mode-lexer--match-length
+ phps-mode-lexer--match-body)))
+
+ (when (fboundp 'thread-yield)
+ (thread-yield))))
+ (setq lambda-i (1+ lambda-i)))))
;; Did we find a match?
(if phps-mode-lexer--match-length
(progn
(phps-mode-debug-message
(message
- "Found match %s"
+ "Found final match %s"
phps-mode-lexer--match-body))
(phps-mode-lexer--re2c-execute)
diff --git a/phps-mode-macros.el b/phps-mode-macros.el
index bad8a8a2ca..721401aeda 100644
--- a/phps-mode-macros.el
+++ b/phps-mode-macros.el
@@ -9,7 +9,7 @@
(defconst
phps-mode-macrotime-debug
- nil
+ t
"Debug messages during macro expansion time, default nil.")
(defmacro phps-mode-debug-message (&rest code)