def as_call
bolt@1.27.0.0 · src/rules/pedantic/rewalk.bend:163
import bolt@1.27.0.0/src/rules/pedantic/rewalk.bend as Rewalk
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
163
164def as_call(nn: Tree.Node) -> Maybe<&2, Lex.Tok>:
165 match nn:
166 case Tree.NCons{Tree.Group{Lex.Tok{k, +o, l, c}, +kids, close}, Tree.NNil{}}:
167 as_wrapped(String.eq(o, "("), kids)
168 case Tree.NCons{Tree.Leaf{tok}, Tree.NCons{Tree.Group{Lex.Tok{k, +o, l, c}, kids, close}, Tree.NNil{}}}:
169 as_open(String.eq(o, "("), tok)
170 case other:
171 None{}