Parse-conditional-expression
Parse a conditional expression.
- Signature
(parse-conditional-expression parstate)
→
(mv erp expr span new-parstate)
- Arguments
- parstate — Guard (parstatep parstate).
- Returns
- expr — Type (exprp expr).
- span — Type (spanp span).
- new-parstate — Type (parstatep new-parstate), given (parstatep parstate).
According to the grammar, this may be
not only a conditional expression,
but also a logical disjunction expression.
These two both start with a logical disjunction expression,
which we parse first,
and then we check whether there is a ?:
if there is, it must be a conditional expression proper;
if there is not, it must be a logical disjunction expression.