mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
LibJS: Make Token use the new double parser
This commit is contained in:
parent
9921f80817
commit
7db59124e8
1 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include "Token.h"
|
#include "Token.h"
|
||||||
#include <AK/Assertions.h>
|
#include <AK/Assertions.h>
|
||||||
#include <AK/CharacterTypes.h>
|
#include <AK/CharacterTypes.h>
|
||||||
|
#include <AK/FloatingPointStringConversions.h>
|
||||||
#include <AK/GenericLexer.h>
|
#include <AK/GenericLexer.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
|
|
||||||
|
@ -79,7 +80,8 @@ double Token::double_value() const
|
||||||
return static_cast<double>(strtoul(value_string.characters() + 1, nullptr, 8));
|
return static_cast<double>(strtoul(value_string.characters() + 1, nullptr, 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return strtod(value_string.characters(), nullptr);
|
// This should always be a valid double
|
||||||
|
return value_string.to_double().release_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 hex2int(char x)
|
static u32 hex2int(char x)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue