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