20 lines
753 B
Nim
20 lines
753 B
Nim
# SPDX-FileCopyrightText: ☭ Emery Hemingway
|
|
# SPDX-License-Identifier: Unlicense
|
|
|
|
import ./protocols/[protocol, trace]
|
|
export trace
|
|
|
|
proc traceAction*(e: protocol.Event): trace.TurnEvent =
|
|
var act = ActionDescription(orKind: ActionDescriptionKind.enqueue)
|
|
act.enqueue.event = TargetedTurnEvent(
|
|
target: cap.traceTarget,
|
|
detail: trace.TurnEvent(orKind: trace.TurnEventKind.assert)
|
|
)
|
|
act.enqueue.event.detail = trace.TurnEvent(orKind: TurnEventKind.assert)
|
|
act.enqueue.event.detail.assert = TurnEventAssert(
|
|
assertion: AssertionDescription(orKind: AssertionDescriptionKind.value),
|
|
handle: result,
|
|
)
|
|
act.enqueue.event.detail.assert.assertion.value.value = val
|
|
turn.desc.actions.add act
|