Logo Search packages:      
Sourcecode: yajl version File versions

yajl_status yajl_parse_complete ( yajl_handle  hand  ) 

Parse any remaining buffered json. Since yajl is a stream-based parser, without an explicit end of input, yajl sometimes can't decide if content at the end of the stream is valid or not. For example, if "1" has been fed in, yajl can't know whether another digit is next or some character that would terminate the integer token.

hand - a handle to the json parser allocated with yajl_alloc

Definition at line 127 of file yajl.c.

References yajl_parse(), and yajl_parse_complete().

Referenced by yajl_parse_complete().

    /* The particular case we want to handle is a trailing number.
     * Further input consisting of digits could cause our interpretation
     * of the number to change (buffered "1" but "2" comes in).
     * A very simple approach to this is to inject whitespace to terminate
     * any number in the lex buffer.
    return yajl_parse(hand, (const unsigned char *)" ", 1);

Generated by  Doxygen 1.6.0   Back to index