[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/wisi 7cb03cb 10/35: * packages/ada-mode/* : version 5.1
From: |
Stefan Monnier |
Subject: |
[elpa] externals/wisi 7cb03cb 10/35: * packages/ada-mode/* : version 5.1.5 |
Date: |
Sat, 28 Nov 2020 14:47:51 -0500 (EST) |
branch: externals/wisi
commit 7cb03cbd53094e8f1e4fe28381f2a0acffacc7ad
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Commit: Stephen Leake <stephen_leake@stephe-leake.org>
* packages/ada-mode/* : version 5.1.5
* packages/ada-mode/ada-mode.texi: New file.
* packages/ada-mode/gpr-mode.texi: New file.
* packages/wisi/* : version 1.0.5
---
NEWS | 7 ++++++
wisi-parse.el | 8 +++++++
wisi.el | 71 ++++++++++++++++++++++++++++++++---------------------------
3 files changed, 54 insertions(+), 32 deletions(-)
diff --git a/NEWS b/NEWS
index a1da0cf..9aa5938 100755
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,13 @@ Please send wisi bug reports to bug-gnu-emacs@gnu.org, with
'wisi' in the subject. If possible, use M-x report-emacs-bug.
+* wisi 1.0.5
+12 Jul 2014
+
+** wisi-parse-max-parallel-current - new variable for debugging slow parsing
issues
+
+** wisi-set-end - new algorithm giving significant speedup
+
* wisi 1.0.4
19 Apr 2014
diff --git a/wisi-parse.el b/wisi-parse.el
index 906d19b..bd7ce7e 100755
--- a/wisi-parse.el
+++ b/wisi-parse.el
@@ -75,6 +75,10 @@
If a file needs more than this, it's probably an indication that
the grammar is excessively redundant.")
+(defvar wisi-parse-max-parallel-current (cons 0 0)
+ "Cons (count . point); Maximum number of parallel parsers used in most
recent parse,
+point at which that max was spawned.")
+
(defvar wisi-debug 0
"wisi debug mode:
0 : normal - ignore parse errors, for indenting new code
@@ -107,6 +111,8 @@ the grammar is excessively redundant.")
(token (funcall lexer))
some-pending)
+ (setq wisi-parse-max-parallel-current (cons 0 0))
+
(aset (wisi-parser-state-stack (aref parser-states 0)) 0 0) ;; Initial
state
(while (not (eq active 'accept))
@@ -144,6 +150,8 @@ the grammar is excessively redundant.")
)))
)
(setq active-parser-count (1+ active-parser-count))
+ (when (> active-parser-count (car
wisi-parse-max-parallel-current))
+ (setq wisi-parse-max-parallel-current (cons
active-parser-count (point))))
(setf (wisi-parser-state-label result) j)
(aset parser-states j result))
(when (> wisi-debug 1)
diff --git a/wisi.el b/wisi.el
index 02a2b6e..d4cd8e6 100755
--- a/wisi.el
+++ b/wisi.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2012 - 2014 Free Software Foundation, Inc.
;;
;; Author: Stephen Leake <stephen_leake@member.fsf.org>
-;; Version: 1.0.4
+;; Version: 1.0.5
;; package-requires: ((cl-lib "0.4") (emacs "24.2"))
;; URL: http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html
;;
@@ -333,12 +333,16 @@ wisi-forward-token, but does not look up symbol."
(defvar-local wisi-change-need-invalidate nil)
+(defvar wisi-end-caches nil
+ "List of buffer positions of caches in current statement that need
wisi-cache-end set.")
+
(defun wisi-invalidate-cache()
"Invalidate the wisi token cache for the current buffer.
Also invalidate the Emacs syntax cache."
(interactive)
(setq wisi-cache-max 0)
(setq wisi-parse-try t)
+ (setq wisi-end-caches nil)
(syntax-ppss-flush-cache (point-min))
(with-silent-modifications
(remove-text-properties (point-min) (point-max) '(wisi-cache))))
@@ -527,31 +531,29 @@ Point must be at cache."
;;;; parse actions
-(defun wisi-set-end (tokens end-mark)
- "Set END-MARK on all unset caches in TOKENS."
- (let ((tokens-t tokens))
- (while tokens-t
- (let* ((token (pop tokens-t))
- (region (cddr token))
- cache)
- (when region
- (goto-char (car region))
- (setq cache (wisi-get-cache (car region)))
- (when (not cache)
- ;; token is non-terminal; first terminal doesn't have cache.
- (setq cache (wisi-forward-cache)))
- (while (and cache
- (< (point) (cdr region)))
- (if (not (wisi-cache-end cache))
- (setf (wisi-cache-end cache) end-mark)
- (goto-char (wisi-cache-end cache))
- )
- (setq cache (wisi-forward-cache))
- ))
- ))
- ))
+(defun wisi-set-end (start-mark end-mark)
+ "Set END-MARK on all caches in `wisi-end-caches' in range START-MARK
END-MARK,
+delete from `wisi-end-caches'."
+ (let ((i 0)
+ pos cache)
+ (while (< i (length wisi-end-caches))
+ (setq pos (nth i wisi-end-caches))
+ (setq cache (wisi-get-cache pos))
+
+ (if (and (>= pos start-mark)
+ (< pos end-mark))
+ (progn
+ (setf (wisi-cache-end cache) end-mark)
+ (setq wisi-end-caches (delq pos wisi-end-caches)))
+
+ ;; else not in range
+ (setq i (1+ i)))
+ )))
+
+(defvar wisi-tokens nil)
+;; keep byte-compiler happy; `wisi-tokens' is bound in action created
+;; by wisi-semantic-action
-(defvar wisi-tokens nil);; keep byte-compiler happy; `wisi-tokens' is bound in
action created by wisi-semantic-action
(defun wisi-statement-action (&rest pairs)
"Cache information in text properties of tokens.
Intended as a grammar non-terminal action.
@@ -618,22 +620,27 @@ that token. Use in a grammar action as:
(1+ (car region))
'wisi-cache
(wisi-cache-create
- :nonterm $nterm;; $nterm defined in wisi-semantic-action
- :token token
- :last (- (cdr region) (car region))
- :class (or override-start class)
- :containing first-keyword-mark)
- )))
+ :nonterm $nterm;; $nterm defined in
wisi-semantic-action
+ :token token
+ :last (- (cdr region) (car region))
+ :class (or override-start class)
+ :containing first-keyword-mark)
+ ))
+ (if wisi-end-caches
+ (push (car region) wisi-end-caches)
+ (setq wisi-end-caches (list (car region)))
+ ))
(when first-item
(setq first-item nil)
(when (or override-start
+ ;; FIXME: why block-middle here?
(memq class '(block-middle block-start
statement-start)))
(setq override-start nil)
(setq first-keyword-mark mark)))
(when (eq class 'statement-end)
- (wisi-set-end wisi-tokens (copy-marker (1+ (car region)))))
+ (wisi-set-end (1- first-keyword-mark) (copy-marker (1+ (car
region)))))
)
;; region is nil when a production is empty; if the first
- [elpa] branch externals/wisi created (now dd09dcf), Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 931fc16 16/35: * packages/gnome-c-style/gnome-c-tests.el: Add copyright blurb, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 2f33bf8 21/35: Release Ada mode 5.3.1, wisi 1.1.6, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi e91f482 03/35: * wisi: Fix up dependency and sectioning style., Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 60b8ef1 15/35: Update ada-mode, wisi, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi d10db37 22/35: Release ada-mode version 6.0. Release wisi version 2.0, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi a4e4907 01/35: Add ada-mode, wisi packages, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 922e27f 04/35: * wisi: Fix warnings and a few 80-columns overruns, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 0635f1a 14/35: * packages/wisi: Use lexical binding. Fix dos EOL. Fix EOB markers, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 7cb03cb 10/35: * packages/ada-mode/* : version 5.1.5,
Stefan Monnier <=
- [elpa] externals/wisi cb45dd5 07/35: * packages/ada-mode: version 5.1.1: fix wisi packaging bug, add -a in gnat-find, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 8bdcee1 11/35: publish ada-mode 5.1.6, wisi 1.0.6, new package ada-ref-man, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 364da46 20/35: Update ada-mode to version 5.2.2, wisi to version 1.1.5, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 89eee25 23/35: Release ada-mode 6.0.1, wisi 2.0.1; fix copyright, packaging bugs, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi d0eac6a 34/35: Forgot some new files in wisi, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi a6b3115 24/35: * ada-mode, wisi: Fix file access rights, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi bd1884c 02/35: Fix up copyright notices., Stefan Monnier, 2020/11/28
- [elpa] externals/wisi c282a4b 13/35: update ada-mode, wisi, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 27db81d 17/35: Fix some quoting problems in doc strings, Stefan Monnier, 2020/11/28
- [elpa] externals/wisi 724a763 31/35: In wisi sal-gen_unbounded_definite_red_black_trees.adb, correct WORKAROUND, Stefan Monnier, 2020/11/28