catchClause method
Implementation
Parser<CatchClauseNode> catchClause() => seq2(
[
// on Type catch (e, s)
seq4(
ref0(onToken),
ref0(type),
ref0(catchParameters).optional(),
ref0(block),
).map4(
(_, type, params, b) => CatchClauseNode(
exceptionType: type,
exceptionParameter: params?.$1,
stackTraceParameter: params?.$2,
body: b,
),
),
// catch (e, s)
seq2(ref0(catchParameters), ref0(block)).map2(
(params, b) => CatchClauseNode(
exceptionParameter: params.$1,
stackTraceParameter: params.$2,
body: b,
),
),
].toChoiceParser(),
epsilon(),
).map2((c, _) => c);