From 42fb6de0b366622cd59006f69fbc13c5cf3a0714 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 27 Dec 2020 21:33:07 +0100 Subject: 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. --- lisp/emacs-lisp/comp-cstr.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp/emacs-lisp/comp-cstr.el') diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 28cffcf0661..57d93912d2f 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -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. -- cgit v1.2.3