def appended

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

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

50# the list a call appends onto: List.append's first list, String.append's first
51def appended(+tt: String, as: List<&2, Tree.Node>) -> Maybe<&2, Lex.Tok>:
52  +list = String.eq(tt, "List.append")
53  +str = String.eq(tt, "String.append")
54  Bool.pick(Maybe<&2, Lex.Tok>, Bool.or(list, str), lone(Calls.arg(as, Bool.pick(Nat, list, 2n, 0n))), None{})

Uses (11)

Used by (1)