buildCascade function

ValueNode buildCascade(
  1. ValueNode value,
  2. List parts
)

Implementation

ValueNode buildCascade(ValueNode value, List parts) {
  if (parts.isNotEmpty) {
    final result = CascadeNode();
    result.messages.add(value as MessageNode);
    for (final part in parts) {
      final message = buildMessage(result.receiver, [part[1]]);
      result.messages.add(message as MessageNode);
      result.semicolons.add(part[0]);
    }
    return result;
  }
  return value;
}