From 665de8017d0ff92e3b90cab64d876be0fe790c72 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sun, 29 Jan 2023 20:27:54 -0500 Subject: with-all: give up and just do a trie scan for now --- virtual-programs/with-all.folk | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/with-all.folk b/virtual-programs/with-all.folk index da40420b..072063a9 100644 --- a/virtual-programs/with-all.folk +++ b/virtual-programs/with-all.folk @@ -1,29 +1,11 @@ Wish $this has filename "with-all.folk" -set ::collectedMatches [dict create] When when the collected matches for /clause/ are /matchesVar/ /body/ with environment /e/ { - set varNames [lmap word $clause {expr { - [regexp {^/([^/ ]+)/$} $word -> varName] ? $varName : [continue] - }}] - When {*}$clause { - set match [dict create] - foreach varName $varNames { dict set match $varName [set $varName] } - - dict set ::collectedMatches $clause $match true - On unmatch { - if {[dict exists $::collectedMatches $clause]} { - dict unset ::collectedMatches $clause $match - } - } - } When $::nodename has step count /c/ { - set matchId $::matchId Before convergence { - if {[dict exists $::collectedMatches $clause]} { - set matches [dict get $::collectedMatches $clause] - Say the collected matches for $clause are [dict keys $matches] - } + # FIXME: this is a hack, we should do it incrementally + set matches [Statements::findMatches $clause] + Say the collected matches for $clause are $matches } } - On unmatch { dict unset ::collectedMatches $clause } } -- cgit v1.2.3