def fits.step

bend-lint-rules@0.2.0.0 · layout/format.bend:1863

import bend-lint-rules@0.2.0.0/layout/format.bend as Format
import Base

1863def fits.step(jobs: List<&2, Job>, left: U32) -> Fit:
1864  match jobs:
1865    case Nil{}:
1866      Stop{True{}}
1867    case Con{Job{Str{body, blank, width, tail}, indent, flat}, rest}:
1868      fits.width(Maybe.is_some(&2, U32, tail), width, rest, left)
1869    case Con{Job{Line{text, width, hard, offset}, indent, flat}, rest}:
1870      fits.width(hard || Bool.not(flat), width, rest, left)
1871    case Con{Job{Grp{doc, f}, indent, flat}, rest}:
1872      fits.flat(f, rest, left)
1873    case Con{Job{Nest{doc, amount, f}, indent, flat}, rest}:
1874      fits.flat(f, rest, left)
1875    case Con{Job{Cat{docs, f}, indent, True{}}, rest}:
1876      fits.flat(f, rest, left)
1877    case Con{Job{Cat{docs, f}, indent, False{}}, rest}:
1878      Go{push(docs, indent, False{}, rest), left}

Uses (12)

Used by (1)