mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-04 02:51:31 -08:00
Normalise setq during macro-expansion
Early normalisation of setq during macroexpand-all allows later stages, cconv, byte-opt and codegen, to be simplified and duplicated checks to be eliminated. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Normalise all setq forms to a sequence of (setq VAR EXPR). Emit warnings if necessary. * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form): * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): * lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Simplify. * test/lisp/emacs-lisp/bytecomp-tests.el: Adapt and add tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el; * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el: New files.
This commit is contained in:
parent
175bc8e5a5
commit
6825e5686a
7 changed files with 100 additions and 74 deletions
|
|
@ -951,11 +951,17 @@ byte-compiled. Run with dynamic binding."
|
|||
"let-bind nonvariable")
|
||||
|
||||
(bytecomp--define-warning-file-test "warn-variable-set-constant.el"
|
||||
"variable reference to constant")
|
||||
"attempt to set constant")
|
||||
|
||||
(bytecomp--define-warning-file-test "warn-variable-set-nonvariable.el"
|
||||
"variable reference to nonvariable")
|
||||
|
||||
(bytecomp--define-warning-file-test "warn-variable-setq-nonvariable.el"
|
||||
"attempt to set non-variable")
|
||||
|
||||
(bytecomp--define-warning-file-test "warn-variable-setq-odd.el"
|
||||
"odd number of arguments")
|
||||
|
||||
(bytecomp--define-warning-file-test
|
||||
"warn-wide-docstring-autoload.el"
|
||||
"autoload .foox. docstring wider than .* characters")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue