def has_colon

bolt@1.27.0.0 · src/rules/calls.bend:194

import bolt@1.27.0.0/src/rules/calls.bend as Calls
import Base
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

194# does a chain hold a top-level colon?
195def has_colon(pp: Tree.Node) -> Bool:
196  match pp:
197    case Tree.NCons{h, rest}:
198      Lazy.or_else(kind.leaf(~kind.colon, h), _u => has_colon(rest))
199    case other:
200      False{}

Uses (5)

Used by (2)