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