def literal

bolt@1.27.0.0 · src/rules/pedantic/index.bend:23

import bolt@1.27.0.0/src/rules/pedantic/index.bend as Index
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

23# is the chain exactly one number?
24def literal(nn: Tree.Node) -> Bool:
25  match nn:
26    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TNum{}, t, l, c}}, Tree.NNil{}}:
27      True{}
28    case other:
29      False{}

Uses (4)

Used by (1)