#define LiteralParser_h
#include "Identifier.h"
+#include "JSCJSValue.h"
#include "JSGlobalObjectFunctions.h"
-#include "JSValue.h"
-#include "UString.h"
+#include <array>
+#include <wtf/text/WTFString.h>
namespace JSC {
TokenType type;
const CharType* start;
const CharType* end;
- UString stringBuffer;
+ String stringBuffer;
union {
double numberToken;
struct {
{
}
- UString getErrorMessage()
+ String getErrorMessage()
{
if (!m_lexer.getErrorMessage().isEmpty())
- return String::format("JSON Parse error: %s", m_lexer.getErrorMessage().ascii().data()).impl();
+ return String::format("JSON Parse error: %s", m_lexer.getErrorMessage().ascii().data());
if (!m_parseErrorMessage.isEmpty())
- return String::format("JSON Parse error: %s", m_parseErrorMessage.ascii().data()).impl();
- return "JSON Parse error: Unable to parse JSON string";
+ return String::format("JSON Parse error: %s", m_parseErrorMessage.ascii().data());
+ return ASCIILiteral("JSON Parse error: Unable to parse JSON string");
}
JSValue tryLiteralParse()
return m_currentToken;
}
- UString getErrorMessage() { return m_lexErrorMessage; }
+ String getErrorMessage() { return m_lexErrorMessage; }
private:
- UString m_lexErrorMessage;
+ String m_lexErrorMessage;
template <ParserMode mode> TokenType lex(LiteralParserToken<CharType>&);
ALWAYS_INLINE TokenType lexIdentifier(LiteralParserToken<CharType>&);
template <ParserMode mode, char terminator> ALWAYS_INLINE TokenType lexString(LiteralParserToken<CharType>&);
ExecState* m_exec;
typename LiteralParser<CharType>::Lexer m_lexer;
ParserMode m_mode;
- UString m_parseErrorMessage;
+ String m_parseErrorMessage;
static unsigned const MaximumCachableCharacter = 128;
- FixedArray<Identifier, MaximumCachableCharacter> m_shortIdentifiers;
- FixedArray<Identifier, MaximumCachableCharacter> m_recentIdentifiers;
+ std::array<Identifier, MaximumCachableCharacter> m_shortIdentifiers;
+ std::array<Identifier, MaximumCachableCharacter> m_recentIdentifiers;
ALWAYS_INLINE const Identifier makeIdentifier(const LChar* characters, size_t length);
ALWAYS_INLINE const Identifier makeIdentifier(const UChar* characters, size_t length);
};