Updates from BitShares FC #22
1 changed files with 41 additions and 49 deletions
|
|
@ -626,17 +626,9 @@ namespace fc { namespace json_relaxed
|
||||||
variant variant_from_stream( T& in )
|
variant variant_from_stream( T& in )
|
||||||
{
|
{
|
||||||
skip_white_space(in);
|
skip_white_space(in);
|
||||||
variant var;
|
signed char c = in.peek();
|
||||||
while( signed char c = in.peek() )
|
|
||||||
{
|
|
||||||
switch( c )
|
switch( c )
|
||||||
{
|
{
|
||||||
case ' ':
|
|
||||||
case '\t':
|
|
||||||
case '\n':
|
|
||||||
case '\r':
|
|
||||||
in.get();
|
|
||||||
continue;
|
|
||||||
case '"':
|
case '"':
|
||||||
return json_relaxed::stringFromStream<T, strict>( in );
|
return json_relaxed::stringFromStream<T, strict>( in );
|
||||||
case '{':
|
case '{':
|
||||||
|
|
@ -671,11 +663,11 @@ namespace fc { namespace json_relaxed
|
||||||
case 0x04: // ^D end of transmission
|
case 0x04: // ^D end of transmission
|
||||||
case EOF:
|
case EOF:
|
||||||
FC_THROW_EXCEPTION( eof_exception, "unexpected end of file" );
|
FC_THROW_EXCEPTION( eof_exception, "unexpected end of file" );
|
||||||
|
case 0:
|
||||||
default:
|
default:
|
||||||
FC_THROW_EXCEPTION( parse_error_exception, "Unexpected char '${c}' in \"${s}\"",
|
FC_THROW_EXCEPTION( parse_error_exception, "Unexpected char '${c}' in \"${s}\"",
|
||||||
("c", c)("s", stringFromToken(in)) );
|
("c", c)("s", stringFromToken(in)) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return variant();
|
|
||||||
}
|
|
||||||
} } // fc::json_relaxed
|
} } // fc::json_relaxed
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue