~/bend-docscommunity

src/rules/correctness/foreign.bend fails

raw source on the hub · import 0xde9bb08f7de298b03207fb5797ede9a5/src/rules/correctness/foreign.bend as Foreign

rule foreign: a foreign def (its body only import "./x.c" / import "./x.js" lines) with a body for one lane and not the other. Each lane finds out only when it first runs: a native build (bend -o bin) fails with "no .c import", an interpreted or JS run with "a foreign def without a .js import". Give every foreign def both bodies, x.c and x.js. A file headed # lanes: native never runs on the JS lane, so it needs no .js. Headed means the exact line # lanes: native is one of the file's leading comment lines, those before its first line that does not start with #; the line anywhere later does not count.

7 imports
import Base
import ../../src.bend as Src
import ../../finding.bend as F
import ../../syntax/lex.bend as Lex
import ../../syntax/tree.bend as Tree
import ../../syntax/bind.bend as Bind
import ../../lazy/lazy.bend as Lazy