clone method

  1. @override
ListNode clone({
  1. required bool keepParent,
  2. I18nLocale? locale,
})
override

Deep clones the node.

Implementation

@override
ListNode clone({required bool keepParent, I18nLocale? locale}) {
  final node = ListNode(
    path: path,
    rawPath: rawPath,
    modifiers: modifiers,
    comment: comment,
    entries: entries
        .map((e) => e.clone(keepParent: keepParent, locale: locale))
        .toList(),
  );

  if (keepParent && parent != null) {
    node.setParent(parent!);
  }

  node.setGenericType(genericType);

  return node;
}