def leaf.kind

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

import bolt@1.27.0.0/src/rules/calls.bend as Calls
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# a leaf's kind, none for anything else: kind tests read this, never a text
36def leaf.kind(nn: Tree.Node) -> Maybe<&2, Lex.TokKind>:
37  match nn:
38    case Tree.Leaf{Lex.Tok{k, t, l, c}}:
39      Some{k}
40    case other:
41      None{}

Uses (4)

Used by (1)