def as_inside

bolt@1.27.0.0 · src/rules/pedantic/rewalk.bend:147

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

147# the inside of one pair of parentheses, when it is exactly a call
148def as_inside(nn: Tree.Node) -> Maybe<&2, Lex.Tok>:
149  match nn:
150    case Tree.NCons{Tree.Leaf{tok}, Tree.NCons{Tree.Group{Lex.Tok{k, +o, l, c}, kids, close}, Tree.NNil{}}}:
151      as_open(String.eq(o, "("), tok)
152    case other:
153      None{}

Uses (5)

Used by (1)