|
@@ -417,19 +417,13 @@ JSONValue *Parser::getValue( const char *str )
|
|
|
return new JSONObject( string );
|
|
|
if( Text( (int)string ).istGleich( string.getText() ) )
|
|
|
return new JSONNumber( string );
|
|
|
- if( string.anzahlVon( '.' ) )
|
|
|
+ if( string.anzahlVon( '.' ) == 1 )
|
|
|
{
|
|
|
- Text *first = string.getTeilText( 0, string.positionVon( '.' ) );
|
|
|
- Text *last = string.getTeilText( string.positionVon( '.' ) + 1 );
|
|
|
- if( Text( (int)* first ).istGleich( first->getText() ) &&
|
|
|
- Text( (int)* last ).istGleich( last->getText() ) )
|
|
|
- {
|
|
|
- first->release();
|
|
|
- last->release();
|
|
|
+ bool isNumber = 1;
|
|
|
+ for( char *c = string.getText(); c; c++ )
|
|
|
+ isNumber &= ( *c >= '0' && *c <= '9' ) || *c == '.';
|
|
|
+ if( isNumber )
|
|
|
return new JSONNumber( string );
|
|
|
- }
|
|
|
- first->release();
|
|
|
- last->release();
|
|
|
}
|
|
|
return new JSONValue();
|
|
|
}
|