apidoc::length_braces (private)

 apidoc::length_braces data

Defined in packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl

Parameters:
data (required)
Returns:
length of subexpression, from open to close brace inclusive. Doesn't deal with unescaped braces in substrings.

Partial Call Graph (max 5 caller/called nodes):
%3 apidoc::length_exp apidoc::length_exp (private) apidoc::length_braces apidoc::length_braces apidoc::length_exp->apidoc::length_braces

Testcases:
No testcase defined.
Source code:
        set i 1
        for {set count 1} {1} {incr i} {
            if {[string index $data $i] eq "\\"} {
                incr i
            } elseif {[string index $data $i] eq "\{"} {
                incr count
            } elseif {[string index $data $i] eq "\}"} {
                incr count -1
            }
            if {!$count} { break }
        }
        return [expr {$i+1}]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: