diff options
author | Chong Yidong <cyd@gnu.org> | 2012-10-02 02:10:29 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-10-02 02:10:29 +0800 |
commit | 62a81506f802e4824b718cc30321ee3a0057cdf7 (patch) | |
tree | d681d7b767b1c3f7e4aee24ce39f6bef0d7f1f7e /lisp/cedet/semantic/lex.el | |
parent | b3317662acc0157406c20c8e14c43b7126eaa8a0 (diff) | |
download | emacs-62a81506f802e4824b718cc30321ee3a0057cdf7.tar.gz emacs-62a81506f802e4824b718cc30321ee3a0057cdf7.tar.bz2 emacs-62a81506f802e4824b718cc30321ee3a0057cdf7.zip |
Update CEDET from upstream.
Diffstat (limited to 'lisp/cedet/semantic/lex.el')
-rw-r--r-- | lisp/cedet/semantic/lex.el | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index e47cc1eaee9..d7ab5911a67 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -691,20 +691,6 @@ Return the overlay." (semantic-overlay-put o 'face 'highlight) o)) -(defsubst semantic-lex-debug-break (token) - "Break during lexical analysis at TOKEN." - (when semantic-lex-debug - (let ((o nil)) - (unwind-protect - (progn - (when token - (setq o (semantic-lex-highlight-token token))) - (semantic-read-event - (format "%S :: SPC - continue" token)) - ) - (when o - (semantic-overlay-delete o)))))) - ;;; Lexical analyzer creation ;; ;; Code for creating a lex function from lists of analyzers. @@ -754,6 +740,20 @@ a LOCAL option.") ;;(defvar semantic-lex-timeout 5 ;; "*Number of sections of lexing before giving up.") +(defsubst semantic-lex-debug-break (token) + "Break during lexical analysis at TOKEN." + (when semantic-lex-debug + (let ((o nil)) + (unwind-protect + (progn + (when token + (setq o (semantic-lex-highlight-token token))) + (semantic-read-event + (format "%S :: Depth: %d :: SPC - continue" token semantic-lex-current-depth)) + ) + (when o + (semantic-overlay-delete o)))))) + (defmacro define-lex (name doc &rest analyzers) "Create a new lexical analyzer with NAME. DOC is a documentation string describing this analyzer. @@ -1205,11 +1205,13 @@ symbols returned in open and close tokens." )) )) ((setq match (assoc text ',clist)) - (setq semantic-lex-current-depth (1- semantic-lex-current-depth)) - (semantic-lex-push-token - (semantic-lex-token - (nth 1 match) - (match-beginning 0) (match-end 0))))))) + (if (> semantic-lex-current-depth 0) + (progn + (setq semantic-lex-current-depth (1- semantic-lex-current-depth)) + (semantic-lex-push-token + (semantic-lex-token + (nth 1 match) + (match-beginning 0) (match-end 0))))))))) ))) ;;; Analyzers |