def Lines.next_code

bend-lint-rules@0.2.0.0 · lib/linter/directives.bend:696

import bend-lint-rules@0.2.0.0/lib/linter/directives.bend as Directives
import Base
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists

696# The first line after `after` that holds code; `i` is the line of the head of `lines`.
697def Lines.next_code(
698  lines: List<&2, Bool>,
699  found: Maybe<&2, U32>,
700  +i: U32,
701  +after: U32
702) -> Maybe<&2, U32>:
703  match lines found:
704    case _ Some{x}:
705      Some{x}
706    case Nil{} None{}:
707      None{}
708    case Con{code, rest} None{}:
709      Lines.next_code(rest, Lists.when(U32, code && U32.is_gt(i, after), i), (i + 1: U32), after)

Uses (8)

Used by (1)