def onto.next

bolt@1.27.0.0 · src/rules/suspicious/concat.bend:64

import bolt@1.27.0.0/src/rules/suspicious/concat.bend as Concat
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
import bolt@1.27.0.0/src/rules/calls.bend as Calls

64# a first cell, then the second: a name then `++`, or a call
65def onto.next(+hh: Tree.Node, h2: Tree.Node) -> Maybe<&2, Lex.Tok>:
66  match h2:
67    case Tree.Leaf{Lex.Tok{k, +o, _l, _c}}:
68      Bool.pick(Maybe<&2, Lex.Tok>, Bool.and(Calls.kind.oper(k), String.eq(o, "++")), lone.name(hh), None{})
69    case Tree.Group{open, kids, close}:
70      onto.call(hh, kids)
71    case other:
72      None{}

Uses (9)

Used by (1)