Pkl declares names positionally: no production labels the declared identifier * with a `name` field, so the generic declared-container rule never binds them * and every method name, parameter name, and property name would be re-emitted * as an ordinary read of itself. Each container below holds its declared name * as named child 0; annotations, defaults, and bodies follow it and stay reads. *
| 1040 | * Resolve against the NEAREST container so a nested declaration's own name is |
| 1041 | * the only occurrence its parent can bind. */ |
| 1042 | static bool is_pkl_declaration_binding(TSNode node) { |
| 1043 | static const char *const declaration_kinds[] = {"methodHeader", |
| 1044 | "typedIdentifier", |
| 1045 | "classProperty", |
| 1046 | "objectProperty", |
| 1047 | "clazz", |
| 1048 | "typeAlias", |
| 1049 | NULL}; |
| 1050 | for (TSNode parent = ts_node_parent(node); !ts_node_is_null(parent); |
| 1051 | parent = ts_node_parent(parent)) { |
| 1052 | if (kind_in_exact_set(ts_node_type(parent), declaration_kinds)) { |
| 1053 | return named_child_contains(parent, 0, node); |
| 1054 | } |
| 1055 | } |
| 1056 | return false; |
| 1057 | } |
| 1058 | |
| 1059 | static bool is_policy_binding(CBMExtractCtx *ctx, TSNode node, const CBMOccurrenceSpec *occurrence, |
| 1060 | WalkState *state) { |
no test coverage detected