]> gitweb.factorcode.org Git - factor.git/commitdiff
Tweak stack checker so that we no longer need to do forget-errors during normal usage
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 7 Sep 2008 07:37:13 +0000 (02:37 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 7 Sep 2008 07:37:13 +0000 (02:37 -0500)
basis/stack-checker/backend/backend.factor
basis/stack-checker/errors/errors-docs.factor
basis/stack-checker/errors/errors.factor

index 8a268b79ebbabb9e2cca6258e4ed42b954ca3931..f4cd2c4a8e3892fe611c02a84d90109faf2b55db 100755 (executable)
@@ -144,8 +144,11 @@ M: object apply-object push-literal ;
     [ "inferred-effect" set-word-prop ]
     2tri ;
 
+: cannot-infer-effect ( word -- * )
+    "cannot-infer" word-prop throw ;
+
 : maybe-cannot-infer ( word quot -- )
-    [ ] [ t "cannot-infer" set-word-prop ] cleanup ; inline
+    [ [ "cannot-infer" set-word-prop ] keep throw ] recover ; inline
 
 : infer-word ( word -- effect )
     [
index ffe7c2694382cd469259390f3e84c9a23802b909..f4d7c80e1313005f915ca0512a6fa24f3fe6da90 100644 (file)
@@ -45,11 +45,6 @@ HELP: too-many-r>
     }
 } ;
 
-HELP: cannot-infer-effect
-{ $values { "word" word } }
-{ $description "Throws a " { $link cannot-infer-effect } " error." }
-{ $error-description "Thrown when inference encounters a call to a word which is already known not to have a static stack effect, due to a prior inference attempt failing." } ;
-
 HELP: missing-effect
 { $error-description "Thrown when inference encounters a word lacking a stack effect declaration. Stack effects of words must be declared, with the exception of words which only push literals on the stack." }
 { $examples
@@ -108,7 +103,6 @@ ARTICLE: "inference-errors" "Inference warnings and errors"
 { $subsection inference-error }
 "Inference warnings:"
 { $subsection literal-expected }
-{ $subsection cannot-infer-effect }
 "Inference errors:"
 { $subsection recursive-quotation-error }
 { $subsection unbalanced-branches-error }
index 2d962d5fad5ca551aa31ca557857a8861fe315cb..3d92aea3e831d9d1d6b5fdb82f064d054cdaad61 100644 (file)
@@ -57,14 +57,6 @@ M: too-many-r> summary
     drop
     "Quotation pops retain stack elements which it did not push" ;
 
-TUPLE: cannot-infer-effect word ;
-
-: cannot-infer-effect ( word -- * )
-    \ cannot-infer-effect inference-warning ;
-
-M: cannot-infer-effect error.
-    "Unable to infer stack effect of " write word>> . ;
-
 TUPLE: missing-effect word ;
 
 M: missing-effect error.