def literal

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

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

16# is the chain exactly one number?
17def literal(nn: Tree.Node) -> Bool:
18  match nn:
19    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TNum{}, t, l, c}}, Tree.NNil{}}:
20      True{}
21    case other:
22      False{}

Uses (4)

Used by (1)