def call_name

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

import bolt@1.27.0.0/src/rules/table.bend as Table
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

87# the chain is exactly this call's name, with no arguments that matter: `name()`
88def call_name(nn: Tree.Node) -> String:
89  match nn:
90    case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TName{}, +t, l, c}},
91        Tree.NCons{Tree.Group{Lex.Tok{_, +o, _, _}, kids, _}, Tree.NNil{}}}:
92      Bool.pick(String, String.eq(o, "("), t, "")
93    case other:
94      ""

Uses (6)

Used by (1)