def lex.brace.max
import bend-kit-regex@0.8.0.0/regex.bend as Regeximport Base
290# A "{" that does not start {n}, {n,} or {n,m} is a literal, as in RE2.
291def lex.brace.max(none: Bool, +min: U32, m: Num, orig: String, toks: List<&2, Tok>) -> Lx:
292 match none:
293 case True{}:
294 LGo{orig, TAtom{lit(123)} <> toks}
295 case False{}:
296 Num{+v, n, r} = m
297 match r:
298 case SCon{'}', u}:
299 lex.rep(min, Some{v}, u, toks)
300 case _:
301 LGo{orig, TAtom{lit(123)} <> toks}