ifElement method
Implementation
Parser<IfElementNode> ifElement() =>
seq6(
ref0(ifToken),
ref1(token, '('),
ref0(ifCondition),
ref1(token, ')'),
ref0(collectionElement),
(ref0(elseToken) & ref0(collectionElement))
.map((l) => l[1] as CollectionElementNode)
.optional(),
).map6(
(_, _, cond, _, thenElem, elseElem) => IfElementNode(
condition: cond.$1,
casePattern: cond.$2,
whenGuard: cond.$3,
thenElement: thenElem,
elseElement: elseElem,
),
);