]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/LiteralParser.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / LiteralParser.h
index abe3f95b798cc35b2e46429117b87d11addfff89..fcb79fa401b063d431951827529a2157c8819bc6 100644 (file)
 #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 {
 
@@ -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 <ParserMode mode> TokenType lex(LiteralParserToken<CharType>&);
         ALWAYS_INLINE TokenType lexIdentifier(LiteralParserToken<CharType>&);
         template <ParserMode mode, char terminator> ALWAYS_INLINE TokenType lexString(LiteralParserToken<CharType>&);
@@ -153,10 +154,10 @@ private:
     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);
     };