DSL: rename assert to asserting

Too much of a clash with the assert builtin.
This commit is contained in:
Emery Hemingway 2021-08-28 10:25:02 +02:00
parent 2a09e61f2b
commit 6fd02e74dd
3 changed files with 4 additions and 4 deletions

View File

@ -153,7 +153,7 @@ template onStop*(body: untyped): untyped =
proc getCurrentFacet(): Facet {.inject, used.} = facet
body
template assert*(a: Preserve): untyped =
template asserting*(a: Preserve): untyped =
mixin getCurrentFacet
getCurrentFacet().addEndpoint do (_: Facet) -> EndpointSpec:
result.assertion = a

View File

@ -24,8 +24,8 @@ syndicate timerDriver:
if period > 0:
getCurrentFacet().beginExternalTask()
addTimer(period.int, oneshot = true) do (fd: AsyncFD) -> bool:
react: assert(TimeLaterThan % deadline)
react: asserting(TimeLaterThan % deadline)
getCurrentFacet().endExternalTask()
true
else:
react: assert(TimeLaterThan % deadline)
react: asserting(TimeLaterThan % deadline)

View File

@ -12,7 +12,7 @@ syndicate testDsl:
spawn "box":
field(currentValue, int, 0)
assert(BoxState.init currentValue.get)
asserting(BoxState.init currentValue.get)
stopIf currentValue.get == 10:
echo "box: terminating"
onMessage(SetBox % `?*`) do (newValue: int):