def single

bolt@1.27.0.0 · src/rules/correctness/arms.bend:116

import bolt@1.27.0.0/src/rules/correctness/arms.bend as Arms
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

116# `match x:`: one scrutinee
117def single(kids: Tree.Node) -> Bool:
118  match kids:
119    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TKey{}, +t, l, c}},
120        Tree.NCons{x, Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TColon{}, s, l2, c2}}, Tree.NNil{}}}}:
121      String.eq(t, "match")
122    case other:
123      False{}

Uses (5)

Used by (1)