summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp-cstr.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-12-27 21:33:07 +0100
committerAndrea Corallo <akrl@sdf.org>2020-12-27 21:50:34 +0100
commit42fb6de0b366622cd59006f69fbc13c5cf3a0714 (patch)
tree1aa87b079cccfd96b828b0ef089ddc513d08ed68 /lisp/emacs-lisp/comp-cstr.el
parent7d07a718416d6c24df0719483279c4278dce4acb (diff)
downloademacs-42fb6de0b366622cd59006f69fbc13c5cf3a0714.tar.gz
emacs-42fb6de0b366622cd59006f69fbc13c5cf3a0714.tar.bz2
emacs-42fb6de0b366622cd59006f69fbc13c5cf3a0714.zip
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.
Diffstat (limited to 'lisp/emacs-lisp/comp-cstr.el')
-rw-r--r--lisp/emacs-lisp/comp-cstr.el4
1 files changed, 4 insertions, 0 deletions
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.