Clear handlers
This commit is contained in:
parent
4db9037153
commit
1717abb47a
|
@ -19,6 +19,7 @@ proc rewrite(result: var Assertion; uri: string; regex: Regex) =
|
||||||
|
|
||||||
runActor("main") do (root: Ref; turn: var Turn):
|
runActor("main") do (root: Ref; turn: var Turn):
|
||||||
connectStdio(root, turn)
|
connectStdio(root, turn)
|
||||||
|
var handlers: Table[Handle, RegexAction]
|
||||||
during(turn, root, ?UriRunnerConfig) do (handlerspace: Ref, urispace: Ref):
|
during(turn, root, ?UriRunnerConfig) do (handlerspace: Ref, urispace: Ref):
|
||||||
|
|
||||||
# sanity chek
|
# sanity chek
|
||||||
|
@ -29,7 +30,6 @@ runActor("main") do (root: Ref; turn: var Turn):
|
||||||
|
|
||||||
during(turn, handlerspace, dropType(ActionHandler)) do:
|
during(turn, handlerspace, dropType(ActionHandler)) do:
|
||||||
|
|
||||||
var handlers: Table[Handle, RegexAction]
|
|
||||||
during(turn, handlerspace, ?ActionHandler) do (pat: string; entity: Ref; act: Assertion):
|
during(turn, handlerspace, ?ActionHandler) do (pat: string; entity: Ref; act: Assertion):
|
||||||
# `duringHandle` is a symbol exposed by the `during` macro
|
# `duringHandle` is a symbol exposed by the `during` macro
|
||||||
handlers[duringHandle] = (re(pat, {reIgnoreCase, reStudy}), entity, act,)
|
handlers[duringHandle] = (re(pat, {reIgnoreCase, reStudy}), entity, act,)
|
||||||
|
@ -50,5 +50,5 @@ runActor("main") do (root: Ref; turn: var Turn):
|
||||||
stderr.writeLine "rewrite failed on ", action
|
stderr.writeLine "rewrite failed on ", action
|
||||||
if not matched:
|
if not matched:
|
||||||
stderr.writeLine "no actions matched for ", uri
|
stderr.writeLine "no actions matched for ", uri
|
||||||
|
do:
|
||||||
|
clear(handlers)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "20230518"
|
version = "20230623"
|
||||||
author = "Emery"
|
author = "Emery"
|
||||||
description = "A better xdg-open"
|
description = "A better xdg-open"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
Loading…
Reference in New Issue