def roff_marks

cli@0.2.0.0 · cli.bend:7367

import cli@0.2.0.0/cli.bend as Cli
import Base

7367# Marked lines escaped, after gap: nothing before the first, .br within a
7368# paragraph, sep between paragraphs.
7369def roff_marks(marks: List<&2, Maybe<&2, String>>, +sep: String,
7370    gap: Maybe<&2, String>) -> List<&2, String>:
7371  match marks gap:
7372    case Nil{} _: Nil{}
7373    case None{} <> tail None{}: roff_marks(tail, sep, None{})
7374    case None{} <> tail Some{g}: roff_marks(tail, sep, Some{sep})
7375    case Some{line} <> tail None{}:
7376      Roff.esc(line) <> roff_marks(tail, sep, Some{".br"})
7377    case Some{line} <> tail Some{g}:
7378      g <> Roff.esc(line) <> roff_marks(tail, sep, Some{".br"})

Uses (4)

Used by (1)