def arrow.named

bolt@1.27.0.0 · src/syntax/tree.bend:298

import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex

298# does the chain after an `@` start with a binder's name and a `:`?
299def arrow.named(rest: Node) -> Bool:
300  match rest:
301    case NCons{Leaf{Lex.Tok{Lex.TName{}, _t, _l, _c}}, NCons{Leaf{Lex.Tok{Lex.TColon{}, _ct, _cl, _cc}}, _r}}:
302      True{}
303    case NCons{Leaf{Lex.Tok{Lex.TUpper{}, _t, _l, _c}}, NCons{Leaf{Lex.Tok{Lex.TColon{}, _ct, _cl, _cc}}, _r}}:
304      True{}
305    case _other:
306      False{}

Uses (4)

Used by (1)