require "lib/metaprogramming.nom" require "lib/control_flow.nom" require "lib/operators.nom" require "lib/collections.nom" rule [called by %whitelist] =: if ((%whitelist's "type") != "List"): %whitelist = [%whitelist] %defs = (..) dict ([(nomsu's "defs")->(nomsu "get_stub" [%]), yes] for all %whitelist) for %caller in (nomsu's "callstack"): if (%caller == "#macro"): do next %caller if (%defs -> (nomsu "get_stub" [%caller's 1])): return (yes) return (no) parse [fail unless called by %whitelist] as: unless (called by %whitelist): error "Failed to find \(%whitelist) in callstack."