svghmi/parse_labels.ysl2
changeset 3466 eadb3a85ceb7
parent 3455 2716cd8e498d
child 3469 97622e9560b5
--- a/svghmi/parse_labels.ysl2	Tue May 17 13:22:20 2022 +0200
+++ b/svghmi/parse_labels.ysl2	Tue May 17 14:49:23 2022 +0200
@@ -44,7 +44,12 @@
     if "$type" widget {
         attrib "id" > «$id»
         attrib "type" > «$type»
-        if "$freq" attrib "freq" > «$freq»
+        if "$freq" {
+            if "not(regexp:test($freq,'^[0-9]*(\.[0-9]+)?[smh]'))" {
+                error > Widget id:«$id» label:«$label» has wrong syntax of frequency forcing «$freq»
+            }
+            attrib "freq" > «$freq»
+        }
         foreach "str:split(substring-after($args, ':'), ':')" {
             arg {
                 attrib "value" > «.»