def Syntax.binder
import bend-lint-api@0.2.0.0/linter/lint.bend as Lintimport Base
167# The binder a node of this kind declares, or, for a variable, uses.
168def Syntax.binder(syntax: Syntax) -> Maybe<&2, U32>:
169 match syntax:
170 case Parameter{b, q}:
171 Some{b}
172 case Field{b, q}:
173 Some{b}
174 case Variable{b}:
175 Some{b}
176 case Binding{b, q}:
177 Some{b}
178 case Forall{b, q}:
179 Some{b}
180 case Lambda{b, q}:
181 Some{b}
182 case PatternVariable{b, q}:
183 Some{b}
184 case _:
185 None{}