def param_name
bolt@1.27.0.0 · src/rules/calls.bend:170
import bolt@1.27.0.0/src/rules/calls.bend as Calls
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
170
171
172def param_name(pp: Tree.Node) -> String:
173 match pp:
174 case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TName{}, t, l, c}}, rest}:
175 t
176 case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TColon{}, t, l, c}}, rest}:
177 ""
178 case Tree.NCons{h, rest}:
179 param_name(rest)
180 case other:
181 ""