parseComparison method
Reads one comparison of two sums, or a sum alone. Throws an
ExpressionSyntaxException for a second comparison after the first
(a < b < c), for a side that is not one number (two truth values may
be compared with == and != only), and for two sides of different
dimensions.
Implementation
Expression parseComparison() {
final left = parseSum();
const comparisons = <String>{'<', '<=', '>', '>=', '==', '!='};
if (!comparisons.contains(current.kind)) return left;
final op = expectToken(current.kind, 'an operator');
final right = parseSum();
if (comparisons.contains(current.kind)) {
fail('comparisons do not chain: write "a < b && b < c".', where: current);
}
return comparison(op, left, right);
}