def strs

ezx@1.11.0.0 · src/ws/workspace.bend:413

import ezx@1.11.0.0/src/ws/workspace.bend as Workspace
import Base
import emerging-eztoml@0.9.0.0/main.bend as E

413# every item of an array as text, or nothing when one is not a string
414def strs(items: List<&2, E.Val>) -> Maybe<&2, List<&2, String>>:
415  match items:
416    case []:
417      Some{[]}
418    case E.VStr{text} <> tl:
419      cut.cons(text, strs(tl))
420    case E.VSpan{src, nn} <> tl:
421      cut.cons(E.string(E.VSpan{src, nn}), strs(tl))
422    case _hd <> tl:
423      None{}

Uses (6)

Used by (1)