util::json::parseArrayElements (private)

 util::json::parseArrayElements tokens nrTokens tokenCursorName \
    resultName

Defined in packages/acs-tcl/tcl/json-procs.tcl

Parse the elements of an array

Parameters:
tokens (required)
list of tokens
nrTokens (required)
length of $tokens
tokenCursorName (required)
name (in caller's context) of variable holding current position in $tokens
resultName (required)
name (in caller's context) of the list representing the JSON array

Partial Call Graph (max 5 caller/called nodes):
%3 util::json::parseArray util::json::parseArray (private) util::json::parseArrayElements util::json::parseArrayElements util::json::parseArray->util::json::parseArrayElements util::json::parseValue util::json::parseValue (private) util::json::parseArrayElements->util::json::parseValue util::json::unexpected util::json::unexpected (private) util::json::parseArrayElements->util::json::unexpected

Testcases:
No testcase defined.
Source code:
    upvar $tokenCursorName tokenCursor
    upvar $resultName result

    while true {
        lappend result [parseValue $tokens $nrTokens tokenCursor]

        if {$tokenCursor == $nrTokens} {
            unexpected $tokenCursor "END" "\",\"|\"\]\""
        } else {
            set token [lindex $tokens $tokenCursor]
            incr tokenCursor

            switch -exact $token {
                "," {
                    # continue
                }
                "\]" {
                    break
                }
                default {
                    unexpected $tokenCursor $token "\",\"|\"\]\""
                }
            }
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: