Dimb-stmt
Disambiguate a statement.
- Signature
(dimb-stmt stmt table) → (mv erp new-stmt new-table)
- Arguments
- stmt — Guard (stmtp stmt).
- table — Guard (dimb-tablep table).
- Returns
- erp — Type (maybe-msgp erp).
- new-stmt — Type (stmtp new-stmt).
- new-table — Type (dimb-tablep new-table).
A compound statement form a new scope.
Thus we push a new scope before the block,
which we pop after the block.
A selection statement forms a new scope, as do its sub-statements
[C17:6.8.4/3].
An iteration statement forms a new scope, as do its sub-statements
[C17:6.8.5/5].
A :gotoe followed by an expression that is an identifier
may need to be re-classified into a :goto.
We base that on whether the identifier is in scope:
if it is not, it must be a label.