def named

bolt@1.27.0.0 · src/rules/style/transcong.bend:35

import bolt@1.27.0.0/src/rules/style/transcong.bend as Transcong
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

35# is the node a leaf of a name kind with this text?
36def named(nn: Tree.Node, +tt: String) -> Bool:
37  match nn:
38    case Tree.Leaf{Lex.Tok{k, t, _l, _c}}:
39      Bool.and(Lex.is_name(k), String.eq(t, tt))
40    case _other:
41      False{}

Uses (7)

Used by (1)