def closes_with

bolt@1.27.0.0 · src/syntax/tree.bend:151

import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex

151# a token that closes a group: `)`, `]`, `}` or a run of `>`
152def closes_with(kk: Lex.TokKind, +tt: String) -> Bool:
153  match kk:
154    case Lex.TClose{}:
155      True{}
156    case Lex.TOp{}:
157      Bool.and(Bool.not(String.is_empty(tt)), all_gt(String.to_list(tt)))
158    case other:
159      False{}

Uses (8)

Used by (1)