summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/wisent
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/semantic/wisent')
-rw-r--r--lisp/cedet/semantic/wisent/comp.el125
-rw-r--r--lisp/cedet/semantic/wisent/grammar.el43
-rw-r--r--lisp/cedet/semantic/wisent/java-tags.el15
-rw-r--r--lisp/cedet/semantic/wisent/javascript.el23
-rw-r--r--lisp/cedet/semantic/wisent/python.el16
-rw-r--r--lisp/cedet/semantic/wisent/wisent.el19
6 files changed, 116 insertions, 125 deletions
diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el
index 755d30a371b..a87ed518909 100644
--- a/lisp/cedet/semantic/wisent/comp.el
+++ b/lisp/cedet/semantic/wisent/comp.el
@@ -1,4 +1,4 @@
-;;; semantic/wisent/comp.el --- GNU Bison for Emacs - Grammar compiler
+;;; semantic/wisent/comp.el --- GNU Bison for Emacs - Grammar compiler -*- lexical-binding: t; -*-
;; Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000-2007, 2009-2021 Free
;; Software Foundation, Inc.
@@ -35,9 +35,6 @@
;;
;; For more details on Wisent itself read the Wisent manual.
-;;; History:
-;;
-
;;; Code:
(require 'semantic/wisent)
(eval-when-compile (require 'cl-lib))
@@ -54,21 +51,22 @@
;; bound locally, without all these "reference to free variable"
;; compiler warnings!
-(defmacro wisent-context-name (name)
- "Return the context name from NAME."
- `(if (and ,name (symbolp ,name))
- (intern (format "wisent-context-%s" ,name))
- (error "Invalid context name: %S" ,name)))
+(eval-when-compile
+ (defun wisent-context-name (name)
+ "Return the context name from NAME."
+ (if (and name (symbolp name))
+ (intern (format "wisent-context-%s" name))
+ (error "Invalid context name: %S" name)))
-(defmacro wisent-context-bindings (name)
- "Return the variables in context NAME."
- `(symbol-value (wisent-context-name ,name)))
+ (defun wisent-context-bindings (name)
+ "Return the variables in context NAME."
+ (symbol-value (wisent-context-name name))))
(defmacro wisent-defcontext (name &rest vars)
"Define a context NAME that will bind variables VARS."
(declare (indent 1))
(let* ((context (wisent-context-name name))
- (declarations (mapcar #'(lambda (v) (list 'defvar v)) vars)))
+ (declarations (mapcar (lambda (v) (list 'defvar v)) vars)))
`(progn
,@declarations
(eval-when-compile
@@ -77,12 +75,8 @@
(defmacro wisent-with-context (name &rest body)
"Bind variables in context NAME then eval BODY."
(declare (indent 1))
- (let ((bindings (wisent-context-bindings name)))
- `(progn
- ,@(mapcar (lambda (binding) `(defvar ,(or (car-safe binding) binding)))
- bindings)
- (let* ,bindings
- ,@body))))
+ `(dlet ,(wisent-context-bindings name)
+ ,@body))
;; Other utilities
@@ -101,6 +95,8 @@ If optional LEFT is non-nil insert spaces on left."
;;;; Environment dependencies
;;;; ------------------------
+;; FIXME: Use bignums or bool-vectors?
+
(defconst wisent-BITS-PER-WORD (logcount most-positive-fixnum))
(defsubst wisent-WORDSIZE (n)
@@ -159,13 +155,9 @@ Its name is defined in constant `wisent-log-buffer-name'."
'(with-current-buffer (wisent-log-buffer)
(erase-buffer)))
-(defvar byte-compile-current-file)
-
(defun wisent-source ()
"Return the current source file name or nil."
- (let ((source (or (and (boundp 'byte-compile-current-file)
- byte-compile-current-file)
- load-file-name (buffer-file-name))))
+ (let ((source (macroexp-file-name)))
(if source
(file-relative-name source))))
@@ -2241,7 +2233,7 @@ there are any reduce/reduce conflicts."
;; output warnings.
(and src
(intern (format "wisent-%s--expected-conflicts"
- (replace-regexp-in-string "\\.el$" "" src))))))
+ (replace-regexp-in-string "\\.el\\'" "" src))))))
(when (or (not (zerop rrc-total))
(and (not (zerop src-total))
(not (= src-total (or wisent-expected-conflicts 0)))
@@ -2778,7 +2770,7 @@ that likes a token gets to handle it."
"Figure out the actions for every state.
Return the action table."
;; Store the semantic action obarray in (unused) RCODE[0].
- (aset rcode 0 (make-vector 13 0))
+ (aset rcode 0 (obarray-make 13))
(let (i j action-table actrow action)
(setq action-table (make-vector nstates nil)
actrow (make-vector ntokens nil)
@@ -3392,7 +3384,7 @@ NONTERMS is the list of non terminal definitions (see function
;;;; Compile input grammar
;;;; ---------------------
-(defun wisent-compile-grammar (grammar &optional start-list)
+(defun wisent--compile-grammar (grammar start-list)
"Compile the LALR(1) GRAMMAR.
GRAMMAR is a list (TOKENS ASSOCS . NONTERMS) where:
@@ -3435,7 +3427,7 @@ where:
(if (wisent-automaton-p grammar)
grammar ;; Grammar already compiled just return it
(wisent-with-context compile-grammar
- (let* ((gc-cons-threshold 1000000))
+ (let* ((gc-cons-threshold (max gc-cons-threshold 1000000)))
(garbage-collect)
(setq wisent-new-log-flag t)
;; Parse input grammar
@@ -3444,7 +3436,7 @@ where:
(wisent-parser-automaton)))))
;;;; --------------------------
-;;;; Byte compile input grammar
+;;;; Obsolete byte compile support
;;;; --------------------------
(require 'bytecomp)
@@ -3453,25 +3445,32 @@ where:
"Byte compile the `wisent-compile-grammar' FORM.
Automatically called by the Emacs Lisp byte compiler as a
`byte-compile' handler."
- ;; Eval the `wisent-compile-grammar' form to obtain an LALR
- ;; automaton internal data structure. Then, because the internal
- ;; data structure contains an obarray, convert it to a lisp form so
- ;; it can be byte-compiled.
(byte-compile-form
- ;; FIXME: we macroexpand here since `byte-compile-form' expects
- ;; macroexpanded code, but that's just a workaround: for lexical-binding
- ;; the lisp form should have to pass through closure-conversion and
- ;; `wisent-byte-compile-grammar' is called much too late for that.
- ;; Why isn't this `wisent-automaton-lisp-form' performed at
- ;; macroexpansion time? --Stef
(macroexpand-all
- (wisent-automaton-lisp-form (eval form)))))
+ (wisent-automaton-lisp-form (eval form t)))))
-;; FIXME: We shouldn't use a `byte-compile' handler. Maybe using a hash-table
-;; instead of an obarray would work around the problem that obarrays
-;; aren't printable. Then (put 'wisent-compile-grammar 'side-effect-free t).
-(put 'wisent-compile-grammar 'byte-compile 'wisent-byte-compile-grammar)
+(defun wisent-compile-grammar (grammar &optional start-list)
+ ;; This is kept for compatibility with FOO-wy.el files generated
+ ;; with older Emacsen.
+ (declare (obsolete wisent-compiled-grammar "Mar 2021"))
+ (wisent--compile-grammar grammar start-list))
+
+(put 'wisent-compile-grammar 'byte-compile #'wisent-byte-compile-grammar)
+
+;;;; --------------------------
+;;;; Byte compile input grammar
+;;;; --------------------------
+;; `wisent--compile-grammar' generates the actual parse table
+;; we need at run-time, but in order to be able to compile the code it
+;; contains, we need to "reify" it back into a piece of ELisp code
+;; which (re)builds it.
+;; This is needed for 2 reasons:
+;; - The parse tables include an obarray and these don't survive the print+read
+;; steps involved in generating a `.elc' file and reading it back in.
+;; - Within the parse table vectors/obarrays we have ELisp functions which
+;; we want to byte-compile, but if we were to just `quote' the table
+;; we'd get them with the same non-compiled functions.
(defun wisent-automaton-lisp-form (automaton)
"Return a Lisp form that produces AUTOMATON.
See also `wisent-compile-grammar' for more details on AUTOMATON."
@@ -3481,16 +3480,16 @@ See also `wisent-compile-grammar' for more details on AUTOMATON."
(let ((obn (make-symbol "ob")) ; Generated obarray name
(obv (aref automaton 3)) ; Semantic actions obarray
)
- `(let ((,obn (make-vector 13 0)))
+ `(let ((,obn (obarray-make 13)))
;; Generate code to initialize the semantic actions obarray,
;; in local variable OBN.
,@(let (obcode)
(mapatoms
- #'(lambda (s)
- (setq obcode
- (cons `(fset (intern ,(symbol-name s) ,obn)
- #',(symbol-function s))
- obcode)))
+ (lambda (s)
+ (setq obcode
+ (cons `(fset (intern ,(symbol-name s) ,obn)
+ #',(symbol-function s))
+ obcode)))
obv)
obcode)
;; Generate code to create the automaton.
@@ -3500,18 +3499,20 @@ See also `wisent-compile-grammar' for more details on AUTOMATON."
;; obarray.
(vector
,@(mapcar
- #'(lambda (state) ;; for each state
- `(list
- ,@(mapcar
- #'(lambda (tr) ;; for each transition
- (let ((k (car tr)) ; token
- (a (cdr tr))) ; action
- (if (and (symbolp a)
- (intern-soft (symbol-name a) obv))
- `(cons ,(if (symbolp k) `(quote ,k) k)
- (intern-soft ,(symbol-name a) ,obn))
- `(quote ,tr))))
- state)))
+ ;; Use name `st' rather than `state' since `state' is
+ ;; defined as dynbound in `semantic-actions' context above :-( !
+ (lambda (st) ;; for each state
+ `(list
+ ,@(mapcar
+ (lambda (tr) ;; for each transition
+ (let ((k (car tr)) ; token
+ (a (cdr tr))) ; action
+ (if (and (symbolp a)
+ (intern-soft (symbol-name a) obv))
+ `(cons ,(if (symbolp k) `(quote ,k) k)
+ (intern-soft ,(symbol-name a) ,obn))
+ `(quote ,tr))))
+ st)))
(aref automaton 0)))
;; The code of the goto table is unchanged.
,(aref automaton 1)
diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el
index cfd4899186b..c5e4554082e 100644
--- a/lisp/cedet/semantic/wisent/grammar.el
+++ b/lisp/cedet/semantic/wisent/grammar.el
@@ -1,4 +1,4 @@
-;;; semantic/wisent/grammar.el --- Wisent's input grammar mode
+;;; semantic/wisent/grammar.el --- Wisent's input grammar mode -*- lexical-binding: t; -*-
;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
;;
@@ -198,10 +198,10 @@ See also the function `wisent-skip-token'."
(defun wisent-grammar-assocs ()
"Return associativity and precedence level definitions."
(mapcar
- #'(lambda (tag)
- (cons (intern (semantic-tag-name tag))
- (mapcar #'semantic-grammar-item-value
- (semantic-tag-get-attribute tag :value))))
+ (lambda (tag)
+ (cons (intern (semantic-tag-name tag))
+ (mapcar #'semantic-grammar-item-value
+ (semantic-tag-get-attribute tag :value))))
(semantic-find-tags-by-class 'assoc (current-buffer))))
(defun wisent-grammar-terminals ()
@@ -209,14 +209,14 @@ See also the function `wisent-skip-token'."
Keep order of declaration in the WY file without duplicates."
(let (terms)
(mapc
- #'(lambda (tag)
- (mapcar #'(lambda (name)
- (add-to-list 'terms (intern name)))
- (cons (semantic-tag-name tag)
- (semantic-tag-get-attribute tag :rest))))
+ (lambda (tag)
+ (mapcar (lambda (name)
+ (add-to-list 'terms (intern name)))
+ (cons (semantic-tag-name tag)
+ (semantic-tag-get-attribute tag :rest))))
(semantic--find-tags-by-function
- #'(lambda (tag)
- (memq (semantic-tag-class tag) '(token keyword)))
+ (lambda (tag)
+ (memq (semantic-tag-class tag) '(token keyword)))
(current-buffer)))
(nreverse terms)))
@@ -228,7 +228,7 @@ Keep order of declaration in the WY file without duplicates."
Return the expanded expression."
(if (or (atom expr) (semantic-grammar-quote-p (car expr)))
expr ;; Just return atom or quoted expression.
- (let* ((expr (mapcar 'wisent-grammar-expand-macros expr))
+ (let* ((expr (mapcar #'wisent-grammar-expand-macros expr))
(macro (assq (car expr) wisent--grammar-macros)))
(if macro ;; Expand Semantic built-in.
(apply (cdr macro) (cdr expr))
@@ -286,12 +286,9 @@ Return the expanded expression."
(defun wisent-grammar-parsetable-builder ()
"Return the value of the parser table."
- `(progn
- ;; Ensure that the grammar [byte-]compiler is available.
- (eval-when-compile (require 'semantic/wisent/comp))
- (wisent-compile-grammar
- ',(wisent-grammar-grammar)
- ',(semantic-grammar-start))))
+ `(wisent-compiled-grammar
+ ,(wisent-grammar-grammar)
+ ,(semantic-grammar-start)))
(defun wisent-grammar-setupcode-builder ()
"Return the parser setup code."
@@ -305,7 +302,7 @@ Return the expanded expression."
semantic-lex-types-obarray %s)\n\
;; Collect unmatched syntax lexical tokens\n\
(add-hook 'wisent-discarding-token-functions\n\
- 'wisent-collect-unmatched-syntax nil t)"
+ #'wisent-collect-unmatched-syntax nil t)"
(semantic-grammar-parsetable)
(buffer-name)
(semantic-grammar-keywordtable)
@@ -325,6 +322,7 @@ Menu items are appended to the common grammar menu.")
(define-derived-mode wisent-grammar-mode semantic-grammar-mode "WY"
"Major mode for editing Wisent grammars."
(semantic-grammar-setup-menu wisent-grammar-menu)
+ (setq-local semantic-grammar-require-form '(require 'semantic/wisent))
(semantic-install-function-overrides
'((semantic-grammar-parsetable-builder . wisent-grammar-parsetable-builder)
(semantic-grammar-setupcode-builder . wisent-grammar-setupcode-builder))))
@@ -479,7 +477,7 @@ Menu items are appended to the common grammar menu.")
(condition-case err
(with-current-buffer (find-file-noselect infile)
(if outdir (setq default-directory outdir))
- (semantic-grammar-create-package nil t))
+ (semantic-grammar-create-package t t))
(error (message "%s" (error-message-string err)) nil)))
output-data)
(when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name))
@@ -514,7 +512,8 @@ Menu items are appended to the common grammar menu.")
(goto-char (point-min))
(delete-region (point-min) (line-end-position))
(insert ";;; " packagename
- " --- Generated parser support file")
+ " --- Generated parser support file "
+ "-*- lexical-binding:t -*-")
(re-search-forward ";;; \\(.*\\) ends here")
(replace-match packagename nil nil nil 1)
(delete-trailing-whitespace))))))
diff --git a/lisp/cedet/semantic/wisent/java-tags.el b/lisp/cedet/semantic/wisent/java-tags.el
index d455c02d1b5..90dd40c51a0 100644
--- a/lisp/cedet/semantic/wisent/java-tags.el
+++ b/lisp/cedet/semantic/wisent/java-tags.el
@@ -1,4 +1,4 @@
-;;; semantic/wisent/java-tags.el --- Java LALR parser for Emacs
+;;; semantic/wisent/java-tags.el --- Java LALR parser for Emacs -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2006, 2009-2021 Free Software Foundation, Inc.
@@ -24,9 +24,6 @@
;;; Commentary:
;;
-;;; History:
-;;
-
;;; Code:
(require 'semantic/wisent)
@@ -92,7 +89,7 @@ This function override `get-local-variables'."
(define-mode-local-override semantic-analyze-unsplit-name java-mode (namelist)
"Assemble the list of names NAMELIST into a namespace name."
- (mapconcat 'identity namelist "."))
+ (mapconcat #'identity namelist "."))
@@ -111,12 +108,12 @@ Use the alternate LALR(1) parser."
(setq
;; Lexical analysis
semantic-lex-number-expression semantic-java-number-regexp
- semantic-lex-analyzer 'wisent-java-tags-lexer
+ semantic-lex-analyzer #'wisent-java-tags-lexer
;; Parsing
- semantic-tag-expand-function 'semantic-java-expand-tag
+ semantic-tag-expand-function #'semantic-java-expand-tag
;; Environment
- semantic-imenu-summary-function 'semantic-format-tag-prototype
- imenu-create-index-function 'semantic-create-imenu-index
+ semantic-imenu-summary-function #'semantic-format-tag-prototype
+ imenu-create-index-function #'semantic-create-imenu-index
semantic-type-relation-separator-character '(".")
semantic-command-separation-character ";"
;; speedbar and imenu buckets name
diff --git a/lisp/cedet/semantic/wisent/javascript.el b/lisp/cedet/semantic/wisent/javascript.el
index 684eea1d93d..1932f205ee0 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -1,4 +1,4 @@
-;;; semantic/wisent/javascript.el --- javascript parser support
+;;; semantic/wisent/javascript.el --- javascript parser support -*- lexical-binding: t; -*-
;; Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
@@ -70,7 +70,7 @@ This function overrides `get-local-variables'."
;; Does javascript have identifiable local variables?
nil)
-(define-mode-local-override semantic-tag-protection js-mode (tag &optional parent)
+(define-mode-local-override semantic-tag-protection js-mode (_tag &optional _parent)
"Return protection information about TAG with optional PARENT.
This function returns on of the following symbols:
nil - No special protection. Language dependent.
@@ -85,7 +85,7 @@ The default behavior (if not overridden with `tag-protection'
is to return a symbol based on type modifiers."
nil)
-(define-mode-local-override semantic-analyze-scope-calculate-access js-mode (type scope)
+(define-mode-local-override semantic-analyze-scope-calculate-access js-mode (_type _scope)
"Calculate the access class for TYPE as defined by the current SCOPE.
Access is related to the :parents in SCOPE. If type is a member of SCOPE
then access would be `private'. If TYPE is inherited by a member of SCOPE,
@@ -101,7 +101,7 @@ This is currently needed for the mozrepl omniscient database."
(save-excursion
(if point (goto-char point))
(let* ((case-fold-search semantic-case-fold)
- symlist tmp end)
+ tmp end) ;; symlist
(with-syntax-table semantic-lex-syntax-table
(save-excursion
(when (looking-at "\\w\\|\\s_")
@@ -110,10 +110,11 @@ This is currently needed for the mozrepl omniscient database."
(unless (re-search-backward "\\s-" (point-at-bol) t)
(beginning-of-line))
(setq tmp (buffer-substring-no-properties (point) end))
+ ;; (setq symlist
(if (string-match "\\(.+\\)\\." tmp)
- (setq symlist (list (match-string 1 tmp)
- (substring tmp (1+ (match-end 1)) (length tmp))))
- (setq symlist (list tmp))))))))
+ (list (match-string 1 tmp)
+ (substring tmp (1+ (match-end 1)) (length tmp)))
+ (list tmp)))))));; )
;;; Setup Function
;;
@@ -127,14 +128,14 @@ This is currently needed for the mozrepl omniscient database."
(wisent-javascript-jv-wy--install-parser)
(setq
;; Lexical Analysis
- semantic-lex-analyzer 'javascript-lexer-jv
+ semantic-lex-analyzer #'javascript-lexer-jv
semantic-lex-number-expression semantic-java-number-regexp
;; semantic-lex-depth nil ;; Full lexical analysis
;; Parsing
- semantic-tag-expand-function 'wisent-javascript-jv-expand-tag
+ semantic-tag-expand-function #'wisent-javascript-jv-expand-tag
;; Environment
- semantic-imenu-summary-function 'semantic-format-tag-name
- imenu-create-index-function 'semantic-create-imenu-index
+ semantic-imenu-summary-function #'semantic-format-tag-name
+ imenu-create-index-function #'semantic-create-imenu-index
semantic-command-separation-character ";"
))
diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
index 7769ad1961b..fb878dde712 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -1,4 +1,4 @@
-;;; wisent-python.el --- Semantic support for Python
+;;; wisent-python.el --- Semantic support for Python -*- lexical-binding: t; -*-
;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc.
@@ -27,8 +27,6 @@
;;; Code:
-(require 'rx)
-
;; Try to load python support, but fail silently since it is only used
;; for optional functionality
(require 'python nil t)
@@ -464,19 +462,19 @@ To be implemented for Python! For now just return nil."
(define-mode-local-override semantic-tag-include-filename python-mode (tag)
"Return a suitable path for (some) Python imports."
(let ((name (semantic-tag-name tag)))
- (concat (mapconcat 'identity (split-string name "\\.") "/") ".py")))
+ (concat (mapconcat #'identity (split-string name "\\.") "/") ".py")))
;; Override ctxt-current-function/assignment defaults, since they do
;; not work properly with Python code, even leading to endless loops
;; (see bug #xxxxx).
-(define-mode-local-override semantic-ctxt-current-function python-mode (&optional point)
+(define-mode-local-override semantic-ctxt-current-function python-mode (&optional _point)
"Return the current function call the cursor is in at POINT.
The function returned is the one accepting the arguments that
the cursor is currently in. It will not return function symbol if the
cursor is on the text representing that function."
nil)
-(define-mode-local-override semantic-ctxt-current-assignment python-mode (&optional point)
+(define-mode-local-override semantic-ctxt-current-assignment python-mode (&optional _point)
"Return the current assignment near the cursor at POINT.
Return a list as per `semantic-ctxt-current-symbol'.
Return nil if there is nothing relevant."
@@ -512,12 +510,12 @@ Shortens `code' tags, but passes through for others."
semantic-type-relation-separator-character '(".")
semantic-command-separation-character ";"
;; Parsing
- semantic-tag-expand-function 'semantic-python-expand-tag
+ semantic-tag-expand-function #'semantic-python-expand-tag
;; Semantic to take over from the one provided by python.
;; The python one, if it uses the senator advice, will hang
;; Emacs unrecoverably.
- imenu-create-index-function 'semantic-create-imenu-index
+ imenu-create-index-function #'semantic-create-imenu-index
;; I need a python guru to update this list:
semantic-symbol->name-assoc-list-for-type-parts '((variable . "Variables")
@@ -557,7 +555,7 @@ SELF or the instance name \"self\" if SELF is nil."
(rx-to-string
`(seq string-start ,(or self "self") "."))
name)
- (not (string-match "\\." (substring name 5)))))))
+ (not (string-search "." (substring name 5)))))))
(defun semantic-python-docstring-p (tag)
"Return non-nil, when TAG is a Python documentation string."
diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el
index 26cf87f8425..62d99ef6972 100644
--- a/lisp/cedet/semantic/wisent/wisent.el
+++ b/lisp/cedet/semantic/wisent/wisent.el
@@ -1,6 +1,6 @@
-;;; semantic/wisent/wisent.el --- GNU Bison for Emacs - Runtime
+;;; semantic/wisent/wisent.el --- GNU Bison for Emacs - Runtime -*- lexical-binding: t; -*-
-;;; Copyright (C) 2002-2007, 2009-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
;; Author: David Ponce <david@dponce.com>
;; Created: 30 January 2002
@@ -34,9 +34,6 @@
;;
;; For more details on Wisent itself read the Wisent manual.
-;;; History:
-;;
-
;;; Code:
(defgroup wisent nil
@@ -139,7 +136,7 @@ POSITIONS are available."
"Print a one-line message if `wisent-parse-verbose-flag' is set.
Pass STRING and ARGS arguments to `message'."
(and wisent-parse-verbose-flag
- (apply 'message string args)))
+ (apply #'message string args)))
;;;; --------------------
;;;; The LR parser engine
@@ -147,13 +144,11 @@ Pass STRING and ARGS arguments to `message'."
(defcustom wisent-parse-max-stack-size 500
"The parser stack size."
- :type 'integer
- :group 'wisent)
+ :type 'integer)
(defcustom wisent-parse-max-recover 3
"Number of tokens to shift before turning off error status."
- :type 'integer
- :group 'wisent)
+ :type 'integer)
(defvar wisent-discarding-token-functions nil
"List of functions to be called when discarding a lexical token.
@@ -397,9 +392,9 @@ automaton has only one entry point."
(wisent-error
(format "Syntax error, unexpected %s, expecting %s"
(wisent-token-to-string wisent-input)
- (mapconcat 'wisent-item-to-string
+ (mapconcat #'wisent-item-to-string
(delq wisent-error-term
- (mapcar 'car (cdr choices)))
+ (mapcar #'car (cdr choices)))
", "))))
;; Increment the error counter
(setq wisent-nerrs (1+ wisent-nerrs))