util::json::parseObjectMember (private)

 util::json::parseObjectMember tokens nrTokens tokenCursorName \
    objectDictName

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

Parse an object member

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
objectDictName (required)
name (in caller's context) of dict representing the JSON object of which to parse the next member

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

Testcases:
No testcase defined.
Source code:

    upvar $tokenCursorName tokenCursor
    upvar $objectDictName objectDict

    set token [lindex $tokens $tokenCursor]
    incr tokenCursor

    set leadingChar [string index $token 0]
    if {$leadingChar eq "\""} {
        set memberName [unquoteUnescapeString $token]

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

            if {$token eq ":"} {
                set memberValue [parseValue $tokens $nrTokens tokenCursor]
                lappend objectDict $memberName $memberValue
            } else {
                unexpected $tokenCursor $token "\":\""
            }
        }
    } else {
        unexpected $tokenCursor $token "STRING"
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: