From 9dcb529e0db440c75b8aafe123c6d0ca05df6c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cuervo?= Date: Sun, 1 Dec 2024 16:59:22 -0500 Subject: [PATCH 1/2] Add single l label with a warning --- virtual-programs/label.folk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index 88a86c18..2d0745ec 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -1,6 +1,15 @@ +set singleLWarning "Use labelled with two l's" + When /thing/ has region /region/ { lassign [region centroid $region] x y set radians [region angle $region] + + When the collected matches for [list /someone/ wishes $thing is labeled /text/ with font /font/] are /matches/ { + set text [join [lmap match $matches {dict get $match text}] "\n"] + if {$text eq ""} { return } + Wish $thing is labelled $text with font [dict get $match font] + Claim $thing has warning $singleLWarning with info $singleLWarning + } When the collected matches for [list /someone/ wishes $thing is labelled /text/ with font /font/] are /matches/ { set text [join [lmap match $matches {dict get $match text}] "\n"] @@ -10,6 +19,11 @@ When /thing/ has region /region/ { } } +When /someone/ wishes /thing/ is labeled /text/ { + Wish $thing is labelled $text + Claim $thing has warning $singleLWarning with info $singleLWarning +} + When /someone/ wishes /thing/ is labelled /text/ { # Set the default font Wish $thing is labelled $text with font "PTSans-Regular" From 0332fe961a98e28fd46a3a78a0253ac87042d930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cuervo?= Date: Mon, 2 Dec 2024 18:44:43 -0500 Subject: [PATCH 2/2] Remove extraneous single l collected matches --- virtual-programs/label.folk | 7 ------- 1 file changed, 7 deletions(-) diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index 2d0745ec..fabc2922 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -4,13 +4,6 @@ When /thing/ has region /region/ { lassign [region centroid $region] x y set radians [region angle $region] - When the collected matches for [list /someone/ wishes $thing is labeled /text/ with font /font/] are /matches/ { - set text [join [lmap match $matches {dict get $match text}] "\n"] - if {$text eq ""} { return } - Wish $thing is labelled $text with font [dict get $match font] - Claim $thing has warning $singleLWarning with info $singleLWarning - } - When the collected matches for [list /someone/ wishes $thing is labelled /text/ with font /font/] are /matches/ { set text [join [lmap match $matches {dict get $match text}] "\n"] if {$text eq ""} { return }