Tweak stack checker so that we no longer need to do forget-errors during normal usage
parent
bbc43e10c5
commit
d14d398895
|
|
@ -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 )
|
||||
[
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue