def lanes.go

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

import bolt@1.27.0.0/src/rules/pedantic/foreign.bend as Foreign
import Base
import bolt@1.27.0.0/src/syntax/tree.bend as Tree

32# the lanes of a body that is only imports; None when it is anything else
33def lanes.go(body: Tree.Node, cc: Bool, js: Bool) -> Maybe<&2, Lanes>:
34  match body:
35    case Tree.NCons{Tree.Stmt{Tree.SImport{}, kids, ib}, rest}:
36      +t = target(kids)
37      lanes.go(rest, Bool.or(cc, String.ends_with(t, ".c\"")), Bool.or(js, String.ends_with(t, ".js\"")))
38    case Tree.NCons{h, rest}:
39      None{}
40    case other:
41      Some{Lanes{cc, js}}

Uses (8)

Used by (1)