Add 1+ 1- integer range propagation support

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-one): New special var.
	* lisp/emacs-lisp/comp.el (comp-fwprop-call): Propagate integer
	ranges on +1 -1.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests.
This commit is contained in:
Andrea Corallo 2020-12-27 21:33:07 +01:00
parent 7d07a71841
commit 42fb6de0b3
3 changed files with 20 additions and 2 deletions

View file

@ -154,6 +154,10 @@ Return them as multiple value."
collect cstr into positives
finally return (cl-values positives negatives)))
(defvar comp-cstr-one (make-comp-cstr :typeset ()
:range '((1 . 1)))
"Represent the integer immediate one (1).")
;;; Value handling.