DSL: rename assert to asserting
Too much of a clash with the assert builtin.
This commit is contained in:
parent
2a09e61f2b
commit
6fd02e74dd
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue