def Split.act

bend-lint-rules@0.2.0.0 · layout/format.bend:1646

import bend-lint-rules@0.2.0.0/layout/format.bend as Format
import Base

1646def Split.act(n: Tree, rest: List<&2, Tree>, sp: Split) -> Act:
1647  match sp:
1648    case Split{parts, newlines, comment, True{}, comments}:
1649      AddEnd{}
1650    case Split{parts, newlines, comment, False{}, comments}:
1651      Bool.pick(
1652        Act,
1653        is_leaf_of(n, Comma{}),
1654        Bool.pick(Act, has_head_comment(rest), AddAttach{}, End{}),
1655        Add{}
1656      )

Uses (9)

Used by (1)