def content

yaml-for-bend@0.1.1.0 · parse.bend:421

import yaml-for-bend@0.1.1.0/parse.bend as Parse
import Base
import yaml-for-bend@0.1.1.0/token.bend as T

421# The node's content, after its anchor and tag.
422def content(k: T.Tok, +block: Bool, +indentless: Bool, +anchor: Maybe<&2, String>, +tag: Tag, +props: Bool, +at: T.Mark, +ps: Ps) -> PStep:
423  match k:
424    case T.BEntry{}:
425      when(PStep, indentless, u => PGo{emit(goto(ps, SIndentless{at}), SeqStartEv{anchor, tag, False{}}, at)},
426        u => content.none(block, props, anchor, tag, at, ps))
427    case T.ScalarTok{text, style}:
428      PGo{take(emit(pop(ps), ScalarEv{anchor, tag, text, style}, at))}
429    case T.FSeqStart{}:
430      PGo{emit(goto(ps, SFSeqFirst{}), SeqStartEv{anchor, tag, True{}}, at)}
431    case T.FMapStart{}:
432      PGo{emit(goto(ps, SFMapFirst{}), MapStartEv{anchor, tag, True{}}, at)}
433    case T.BSeqStart{}:
434      when(PStep, block, u => PGo{emit(goto(ps, SBSeqFirst{}), SeqStartEv{anchor, tag, False{}}, at)},
435        u => content.none(block, props, anchor, tag, at, ps))
436    case T.BMapStart{}:
437      when(PStep, block, u => PGo{emit(goto(ps, SBMapFirst{}), MapStartEv{anchor, tag, False{}}, at)},
438        u => content.none(block, props, anchor, tag, at, ps))
439    case _:
440      content.none(block, props, anchor, tag, at, ps)

Uses (16)

Used by (1)