def bare

bolt@1.27.0.0 · src/rules/pedantic/tail.bend:22

import bolt@1.27.0.0/src/rules/pedantic/tail.bend as Tail
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
import bolt@1.27.0.0/src/syntax/tree.bend as Tree

22# is a statement's chain exactly a call of the name, `name(..)`?
23def bare(kids: Tree.Node, +name: String) -> Bool:
24  match kids:
25    case Tree.NCons{Tree.Leaf{Lex.Tok{k, +t, l, c}}, Tree.NCons{g, Tree.NNil{}}}:
26      Bool.and(String.eq(t, name), Tree.opens(g, "("))
27    case other:
28      False{}

Uses (7)

Used by (1)