diff options
| author | Omar Rizwan <omar@omar.website> | 2023-01-30 01:27:54 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-01-30 01:27:54 +0000 |
| commit | 665de8017d0ff92e3b90cab64d876be0fe790c72 (patch) | |
| tree | 98bfca52cb510b84d467f7961ea3f658c030ac16 /virtual-programs | |
| parent | Guard destructor bc outer/inner execution order is not defined (diff) | |
| download | folk-665de8017d0ff92e3b90cab64d876be0fe790c72.tar.gz folk-665de8017d0ff92e3b90cab64d876be0fe790c72.zip | |
with-all: give up and just do a trie scan for now
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/with-all.folk | 24 |
1 files changed, 3 insertions, 21 deletions
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 } } |
