def lone_num

bolt@1.27.0.0 · src/rules/table.bend:52

import bolt@1.27.0.0/src/rules/table.bend as Table
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

52# the chain is exactly one number
53def lone_num(nn: Tree.Node) -> Bool:
54  match nn:
55    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TNum{}, t, l, c}}, Tree.NNil{}}:
56      True{}
57    case other:
58      False{}

Uses (4)

Used by (2)