def check.width.go

bolt@1.27.0.0 · src/rules/style/wrap.bend:89

import bolt@1.27.0.0/src/rules/style/wrap.bend as Wrap
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex

89# the header's width through its last `:` (upto, once seen says there was
90# one), else its whole width, a string literal counting as two and a
91# comment none
92def check.width.go(toks: List<&2, Lex.Tok>, +acc: U32, +upto: U32, +seen: Bool) -> U32:
93  match toks:
94    case Nil{}:
95      Bool.pick(U32, seen, upto, acc)
96    case Con{Lex.Tok{+kd, tx, _ln, _cl}, rest}:
97      +next = check.add(acc, kd, tx)
98      +colon = check.is_colon(kd)
99      check.width.go(rest, next, Bool.pick(U32, colon, next, upto), Bool.or(colon, seen))

Uses (8)

Used by (1)