Valid-block-item
Validate a block item.
- Signature
(valid-block-item item table ienv)
→
(mv erp new-item return-types last-expr-type? new-table)
- Arguments
- item — Guard (block-itemp item).
- table — Guard (valid-tablep table).
- ienv — Guard (ienvp ienv).
- Returns
- erp — Type (maybe-msgp erp).
- new-item — Type (block-itemp new-item).
- return-types — Type (type-setp return-types).
- last-expr-type? — Type (type-optionp last-expr-type?).
- new-table — Type (valid-tablep new-table).
If validation is successful, we return the same kind of type results
as valid-stmt (see that function's documentation),
with the slight modification that
the last-expr-type? result is a type exactly when
the block item is a compound statement
whose last block item is an expression statement,
in which case the last-expr-type? result is
the type of that expression.
If the block item is a declaration,
the last-expr-type? result is nil,
because the block item is not a statement of the kind
described in valid-stmt.