Clear handlers

This commit is contained in:
Emery Hemingway 2023-06-23 16:23:57 +01:00
parent 4db9037153
commit 1717abb47a
2 changed files with 4 additions and 4 deletions

View File

@ -19,6 +19,7 @@ proc rewrite(result: var Assertion; uri: string; regex: Regex) =
runActor("main") do (root: Ref; turn: var Turn):
connectStdio(root, turn)
var handlers: Table[Handle, RegexAction]
during(turn, root, ?UriRunnerConfig) do (handlerspace: Ref, urispace: Ref):
# sanity chek
@ -29,7 +30,6 @@ runActor("main") do (root: Ref; turn: var Turn):
during(turn, handlerspace, dropType(ActionHandler)) do:
var handlers: Table[Handle, RegexAction]
during(turn, handlerspace, ?ActionHandler) do (pat: string; entity: Ref; act: Assertion):
# `duringHandle` is a symbol exposed by the `during` macro
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
if not matched:
stderr.writeLine "no actions matched for ", uri
do:
clear(handlers)

View File

@ -1,6 +1,6 @@
# Package
version = "20230518"
version = "20230623"
author = "Emery"
description = "A better xdg-open"
license = "Unlicense"