def owns

bolt@1.27.0.0 · src/rules/table.bend:116

import bolt@1.27.0.0/src/rules/table.bend as Table
import Base
import bolt@1.27.0.0/src/syntax/tree.bend as Tree

116# the list argument is a fixed table: inline, a use of a let that holds one,
117# or `name()` / `name` for a table def of the file
118def owns(+nn: Tree.Node, +fixed: List<&2, String>) -> Bool:
119  +called = call_name(nn)
120  +named = lone_name(nn)
121  +used = lone_key(nn)
122  Bool.or(built(nn), Bool.or(
123    Bool.and(Bool.not(String.is_empty(named)),
124      Bool.or(List.contains(~String, ~String.eq, fixed, named), List.contains(~String, ~String.eq, fixed, used))),
125    Bool.and(Bool.not(String.is_empty(called)), List.contains(~String, ~String.eq, fixed, called))))

Uses (14)

Used by (2)