def target

bolt@1.27.0.0 · src/rules/pedantic/foreign.bend:22

import bolt@1.27.0.0/src/rules/pedantic/foreign.bend as Foreign
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

22# the imported path of an import statement's tokens (`"./x.c"`, quoted)
23def target(kids: Tree.Node) -> String:
24  match kids:
25    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TStr{}, t, l, c}}, rest}:
26      t
27    case Tree.NCons{h, rest}:
28      target(rest)
29    case other:
30      ""

Uses (4)

Used by (2)