def literal

bolt@1.27.0.0 · src/rules/perf/chars.bend:27

import bolt@1.27.0.0/src/rules/perf/chars.bend as Chars
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

27# one when a case pattern opens with a character literal, else zero
28def literal(kids: Tree.Node) -> U32:
29  match kids:
30    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TChar{}, t, l, c}}, rest}:
31      1
32    case other:
33      0

Uses (4)

Used by (1)