def Syntax.target

bend-lint-api@0.2.0.0 · linter/lint.bend:121

import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import Base

121# The global name a node of this kind declares or uses, if any (an import's is the file it loads).
122def Syntax.target(syntax: Syntax) -> Maybe<&2, String>:
123  match syntax:
124    case Import{t}:
125      Some{t}
126    case Definition{t, u}:
127      Some{t}
128    case Datatype{t}:
129      Some{t}
130    case Constructor{t}:
131      Some{t}
132    case Law{t}:
133      Some{t}
134    case Reference{t}:
135      Some{t}
136    case TypeApplication{t}:
137      Some{t}
138    case Construction{t}:
139      Some{t}
140    case Literal{t}:
141      Some{t}
142    case Elimination{t}:
143      Some{t}
144    case PatternConstructor{t}:
145      Some{t}
146    case _:
147      None{}

Uses (3)

Used by (2)