Infallible extractors, and some fixes to fallibility in return types (Option<T> vs T).

This commit is contained in:
Chris Fallin
2021-09-09 15:33:15 -07:00
parent 6daa55af82
commit a412cce615
7 changed files with 156 additions and 29 deletions

View File

@@ -171,6 +171,11 @@ pub enum Extern {
/// more precisely the term value that we are extracting, is
/// an "input").
arg_polarity: Option<Vec<ArgPolarity>>,
/// Infallibility: if an external extractor returns `(T1, T2,
/// ...)` rather than `Option<(T1, T2, ...)>`, and hence can
/// never fail, it is declared as such and allows for slightly
/// better code to be generated.
infallible: bool,
},
/// An external constructor: `(constructor Term rustfunc)` form.
Constructor {