X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/LiteralParser.h diff --git a/runtime/LiteralParser.h b/runtime/LiteralParser.h index abe3f95..fcb79fa 100644 --- a/runtime/LiteralParser.h +++ b/runtime/LiteralParser.h @@ -27,9 +27,10 @@ #define LiteralParser_h #include "Identifier.h" +#include "JSCJSValue.h" #include "JSGlobalObjectFunctions.h" -#include "JSValue.h" -#include "UString.h" +#include +#include namespace JSC { @@ -67,7 +68,7 @@ struct LiteralParserToken { TokenType type; const CharType* start; const CharType* end; - UString stringBuffer; + String stringBuffer; union { double numberToken; struct { @@ -94,13 +95,13 @@ public: { } - 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() @@ -133,10 +134,10 @@ private: return m_currentToken; } - UString getErrorMessage() { return m_lexErrorMessage; } + String getErrorMessage() { return m_lexErrorMessage; } private: - UString m_lexErrorMessage; + String m_lexErrorMessage; template TokenType lex(LiteralParserToken&); ALWAYS_INLINE TokenType lexIdentifier(LiteralParserToken&); template ALWAYS_INLINE TokenType lexString(LiteralParserToken&); @@ -153,10 +154,10 @@ private: ExecState* m_exec; typename LiteralParser::Lexer m_lexer; ParserMode m_mode; - UString m_parseErrorMessage; + String m_parseErrorMessage; static unsigned const MaximumCachableCharacter = 128; - FixedArray m_shortIdentifiers; - FixedArray m_recentIdentifiers; + std::array m_shortIdentifiers; + std::array m_recentIdentifiers; ALWAYS_INLINE const Identifier makeIdentifier(const LChar* characters, size_t length); ALWAYS_INLINE const Identifier makeIdentifier(const UChar* characters, size_t length); };