[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/last-cedet-merge f11e08f 10/37: semantic: Fix wise
From: |
David Engster |
Subject: |
[Emacs-diffs] scratch/last-cedet-merge f11e08f 10/37: semantic: Fix wisent parser recursion |
Date: |
Sun, 22 Jan 2017 21:26:31 +0000 (UTC) |
branch: scratch/last-cedet-merge
commit f11e08ff7208a8e71962c1cdc569d63fa0b09211
Author: Martin Stein <address@hidden>
Commit: David Engster <address@hidden>
semantic: Fix wisent parser recursion
* lisp/cedet/semantic/wisent/wisent.el (wisent-parse): The semantic
action might be an EXPAND, EXPANDFULL or some similar action calling
the parser recursively. If the last token of the recursively called
parsing step failed to match it ends up in wisent-lookahead, and
function wisent-parse-stream pushs it back onto
wisent-lex-istream. From there on it simply ends up occuring twice on
the unmatched-syntax-cache, or worse might even lead to parse errors
in rare cases.
Copyright-paperwork-exempt: yes
---
lisp/cedet/semantic/wisent/wisent.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/cedet/semantic/wisent/wisent.el
b/lisp/cedet/semantic/wisent/wisent.el
index 36dff01..1958294 100644
--- a/lisp/cedet/semantic/wisent/wisent.el
+++ b/lisp/cedet/semantic/wisent/wisent.el
@@ -377,7 +377,7 @@ automaton has only one entry point."
(wisent-parse-lexer-function lexer)
(wisent-recovering nil)
(wisent-input (wisent-parse-start start starts))
- state tokid choices choice)
+ state tokid choices choice wisent-lookahead-save)
(setq wisent-nerrs 0 ;; Reset parse error counter
wisent-lookahead nil) ;; and lookahead token
(aset stack 0 0) ;; Initial state
@@ -469,7 +469,12 @@ automaton has only one entry point."
;; Reduce by rule (call semantic action)
;; -------------------------------------
(t
+ ;; save the global variable wisent-lookahead,
+ ;; as the semantic action might be an expand or expandfull
+ ;; which calls this function recursively
+ (setq wisent-lookahead-save wisent-lookahead)
(setq sp (funcall wisent-loop stack sp gotos))
+ (setq wisent-lookahead wisent-lookahead-save)
(or wisent-input (setq wisent-input (wisent-lexer))))))
(run-hooks 'wisent-post-parse-hook)
(car (aref stack 1))))
- [Emacs-diffs] scratch/last-cedet-merge c2d4ad8 23/37: semantic: Update keybinings for grammar mode, (continued)
- [Emacs-diffs] scratch/last-cedet-merge c2d4ad8 23/37: semantic: Update keybinings for grammar mode, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 7308eaf 18/37: semantic: Accept FLAGS parameter for makefile-mode for analyzing completions, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge cc30b46 11/37: EDE: Move ede-global-list-sanity-check to ede/files.el, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 95f8a69 29/37: semantic: More C grammar optimizations, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 2b42323 35/37: EDE: Fix for project detection, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge b4d1399 14/37: EDE: Rework config file detection, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge deaa8c9 24/37: semantic: New function to find library with macro definition, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 6b57c5b 20/37: semantic: Introduce `semantic-analyze-tag-type-members', David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 0a2b38b 26/37: EDE: Expand file name, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge fb127f2 34/37: semantic: C grammar fixes, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge f11e08f 10/37: semantic: Fix wisent parser recursion,
David Engster <=
- [Emacs-diffs] scratch/last-cedet-merge 47471b9 12/37: EDE: Add missing require and silence byte compiler, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 6ca095c 21/37: semantic: Add autoload for Add autoload for `semantic-analyze-debug-assist', David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 5cb7aed 22/37: semantic: New c-mode override for analyzing tag type members, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 8571383 16/37: semantic: Incorporate local scope when finding type, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 74263b1 37/37: semantic: Change unary expression rule, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 03c5f0d 25/37: semantic: Add more syntax modifications for scheme lexer, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge ebc59a5 19/37: semantic: Accept FLAGS parameter for srecode-template-mode, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 02644fe 36/37: semantic: Add missing save-excursion for scope calculation, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge 278c06c 31/37: semantic: Optimize 'typeformbase' in C grammar, David Engster, 2017/01/22
- [Emacs-diffs] scratch/last-cedet-merge cfd7139 28/37: semantic: Some C grammar optimizations, David Engster, 2017/01/22