From e1106cb6d1913e8a4d5e21593e14322c1f01fb56d2d1e6d52cb99c0b68fce87c Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 28 Jun 2025 12:17:34 +0300 Subject: [PATCH] Existence check does not play any role for root element --- tcl/schema.tcl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tcl/schema.tcl b/tcl/schema.tcl index db7007d..30d193d 100755 --- a/tcl/schema.tcl +++ b/tcl/schema.tcl @@ -61,6 +61,11 @@ proc field {k types args} { upvar _cmds _cmds buf buf if {$k != "."} { lappend _cmds [TAKE $k] + if {[lsearch -exact $args !exists] != -1} { + lappend _cmds [!EXISTS] + } elseif {[lsearch -exact $args optional] == -1} { + lappend _cmds [EXISTS] + } } if {[lindex $types 0] == "with"} { lappend _cmds [SCHEMA [lindex $types 1]] @@ -77,11 +82,6 @@ proc field {k types args} { lappend _cmds [TYPE {NIL}] lappend _cmds [TAKE $k] } - if {[lsearch -exact $args !exists] != -1} { - lappend _cmds [!EXISTS] - } elseif {[lsearch -exact $args optional] == -1} { - lappend _cmds [EXISTS] - } set i [lsearch -glob $args "len=*"] if {$i != -1} { set n [string range [lindex $args $i] 4 end] -- 2.50.0