def close.str
bolt@1.27.0.0 · src/rules/suspicious/empty.bend:178
import bolt@1.27.0.0/src/rules/suspicious/empty.bend as Empty
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
178
179def close.str(toks: List<&2, Lex.Tok>) -> Maybe<&2, Taken>:
180 match toks:
181 case Con{Lex.Tok{+k1, +t1, l1, c1}, Con{Lex.Tok{k2, +t2, l2, c2}, rest}}:
182 Bool.pick(Maybe<&2, Taken>, Bool.and(plain(k1), String.eq(code(k2, t2), ")")), Some{Taken{code(k1, t1), rest}},
183 None{})
184 case other:
185 None{}