summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-01-29 14:37:30 +0000
committerOmar Rizwan <omar@omar.website>2023-01-29 14:37:30 +0000
commit8f33120ee32f9320d88ab2c7efbc6df6d908afaa (patch)
treed2370982ac2f2ecb78f38667922a91e81cf3a3ec /virtual-programs
parentHardcode USB device path for keyboard input (diff)
downloadfolk-8f33120ee32f9320d88ab2c7efbc6df6d908afaa.tar.gz
folk-8f33120ee32f9320d88ab2c7efbc6df6d908afaa.zip
Use `When when` to collect matches
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/label.folk1
-rw-r--r--virtual-programs/with-all.folk2
2 files changed, 1 insertions, 2 deletions
diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk
index 2a60c802..b2e06158 100644
--- a/virtual-programs/label.folk
+++ b/virtual-programs/label.folk
@@ -9,7 +9,6 @@ When /thing/ has region /region/ {
set radians [lindex $region 2]
if {$radians eq ""} {set radians 0}
- Wish to collect matches for [list /someone/ wishes $thing is labelled /text/]
When the collected matches for [list /someone/ wishes $thing is labelled /text/] are /matches/ {
set text [join [lmap match $matches {dict get $match text}] "\n"]
if {$text eq ""} { return }
diff --git a/virtual-programs/with-all.folk b/virtual-programs/with-all.folk
index 5f5c3d65..908d6c72 100644
--- a/virtual-programs/with-all.folk
+++ b/virtual-programs/with-all.folk
@@ -1,7 +1,7 @@
Wish $this has filename "with-all.folk"
set ::collectedMatches [dict create]
-When /someone/ wishes to collect matches for /clause/ {
+When when the collected matches for /clause/ are /matches/ /body/ with environment /e/ {
set varNames [lmap word $clause {expr {
[regexp {^/([^/ ]+)/$} $word -> varName] ? $varName : [continue]
}}]