[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/wisi 922e27f 04/35: * wisi: Fix warnings and a few 80-c
From: |
Stefan Monnier |
Subject: |
[elpa] externals/wisi 922e27f 04/35: * wisi: Fix warnings and a few 80-columns overruns |
Date: |
Sat, 28 Nov 2020 14:47:50 -0500 (EST) |
branch: externals/wisi
commit 922e27f3389f7e62d9e5b614fc091b2f5fa8271e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* wisi: Fix warnings and a few 80-columns overruns
---
wisi-parse.el | 36 ++++++++++++++++++++++--------------
wisi.el | 5 ++---
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/wisi-parse.el b/wisi-parse.el
index b62b3d6..4497b39 100755
--- a/wisi-parse.el
+++ b/wisi-parse.el
@@ -75,6 +75,8 @@
If a file needs more than this, it's probably an indication that
the grammar is excessively redundant.")
+(defvar wisi-debug)
+
(defun wisi-parse (automaton lexer)
"Parse input using the automaton specified in AUTOMATON.
@@ -121,14 +123,17 @@ the grammar is excessively redundant.")
(let ((j (wisi-free-parser parser-states)))
(cond
((= j -1)
- ;; add to parser-states; the new parser won't be executed
again in this parser-index loop
+ ;; Add to parser-states; the new parser won't be executed
+ ;; again in this parser-index loop.
(setq parser-states (vconcat parser-states (vector nil)))
(setq j (1- (length parser-states))))
((< j parser-index)
- ;; the new parser won't be executed again in this
parser-index loop; nothing to do
+ ;; The new parser won't be executed again in this
+ ;; parser-index loop; nothing to do.
)
(t
- ;; don't let the new parser execute again in this
parser-index loop
+ ;; Don't let the new parser execute again in this
+ ;; parser-index loop.
(setq some-pending t)
(setf (wisi-parser-state-active result)
(cl-case (wisi-parser-state-active result)
@@ -139,17 +144,20 @@ the grammar is excessively redundant.")
(setq active-parser-count (1+ active-parser-count))
(setf (wisi-parser-state-label result) j)
(aset parser-states j result))
- (when (> wisi-debug 1) (message "spawn parser (%d active)"
active-parser-count)))
+ (when (> wisi-debug 1)
+ (message "spawn parser (%d active)" active-parser-count)))
(when (eq 'error (wisi-parser-state-active parser-state))
(setq active-parser-count (1- active-parser-count))
- (when (> wisi-debug 1) (message "terminate parser (%d active)"
active-parser-count))
+ (when (> wisi-debug 1)
+ (message "terminate parser (%d active)" active-parser-count))
(cl-case active-parser-count
(0
(cond
((= active-parser-count-prev 1)
- ;; we were not in a parallel parse; report the error
- (let ((state (aref (wisi-parser-state-stack parser-state)
(wisi-parser-state-sp parser-state))))
+ ;; We were not in a parallel parse; report the error.
+ (let ((state (aref (wisi-parser-state-stack parser-state)
+ (wisi-parser-state-sp parser-state))))
(signal 'wisi-parse-error
(wisi-error-msg "syntax error in grammar state %d;
unexpected %s, expecting one of %s"
state
@@ -157,9 +165,9 @@ the grammar is excessively redundant.")
(mapcar 'car (aref actions
state))))
))
(t
- ;; report errors from all parsers that failed on this token
+ ;; Report errors from all parsers that failed on this token.
(let ((msg))
- (dotimes (index (length parser-states))
+ (dotimes (_ (length parser-states))
(let* ((parser-state (aref parser-states parser-index))
(state (aref (wisi-parser-state-stack
parser-state)
(wisi-parser-state-sp
parser-state))))
@@ -177,22 +185,22 @@ the grammar is excessively redundant.")
))
(1
- (setf (wisi-parser-state-active parser-state) nil); don't save
error for later
+ (setf (wisi-parser-state-active parser-state) nil); Don't save
error for later.
(wisi-execute-pending (wisi-parser-state-pending
(aref parser-states (wisi-active-parser
parser-states))))
(setf (wisi-parser-state-pending
(aref parser-states (wisi-active-parser parser-states)))
nil))
(t
- ;; we were in a parallel parse, and this parser
+ ;; We were in a parallel parse, and this parser
;; failed; mark it inactive, don't save error for
- ;; later
+ ;; later.
(setf (wisi-parser-state-active parser-state) nil)
)))
)));; end dotimes
(when some-pending
- ;; change pending-* parsers to *
+ ;; Change pending-* parsers to *.
(dotimes (parser-index (length parser-states))
(cond
((eq (wisi-parser-state-active (aref parser-states parser-index))
'pending-shift)
@@ -445,4 +453,4 @@ the first and last tokens of the nonterminal."
))
(provide 'wisi-parse)
-;; end of file
+;;; wisi-parse.el ends here
diff --git a/wisi.el b/wisi.el
index 546d718..faa1e3d 100755
--- a/wisi.el
+++ b/wisi.el
@@ -680,8 +680,7 @@ list (number token_id):
list (number (token_id token_id)):
mark all tokens with token_id in the nonterminal given by the number."
(save-excursion
- (let (next-keyword-mark
- prev-keyword-mark
+ (let (prev-keyword-mark
prev-cache
cache
mark)
@@ -958,7 +957,7 @@ the comment on the previous line."
(defun wisi-indent-paren (offset)
"Return indentation OFFSET relative to preceding open paren."
(save-excursion
- (ada-goto-open-paren 0)
+ (goto-char (nth 1 (syntax-ppss)))
(+ (current-column) offset)))
(defun wisi-indent-start (offset cache)
- [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 <=
- [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, 2020/11/28
- [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