diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/JavaScriptCore/parser/Lexer.h | |
parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/JavaScriptCore/parser/Lexer.h')
-rw-r--r-- | Source/JavaScriptCore/parser/Lexer.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h index d75f2020d..aa1599b96 100644 --- a/Source/JavaScriptCore/parser/Lexer.h +++ b/Source/JavaScriptCore/parser/Lexer.h @@ -146,6 +146,9 @@ private: ALWAYS_INLINE const Identifier* makeIdentifier(const LChar* characters, size_t length); ALWAYS_INLINE const Identifier* makeIdentifier(const UChar* characters, size_t length); + ALWAYS_INLINE const Identifier* makeLCharIdentifier(const LChar* characters, size_t length); + ALWAYS_INLINE const Identifier* makeLCharIdentifier(const UChar* characters, size_t length); + ALWAYS_INLINE const Identifier* makeIdentifierSameType(const UChar* characters, size_t length); ALWAYS_INLINE const Identifier* makeIdentifierLCharFromUChar(const UChar* characters, size_t length); ALWAYS_INLINE bool lastTokenWasRestrKeyword() const; @@ -239,6 +242,18 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeIdentifier(const UChar* characters } template <> +ALWAYS_INLINE const Identifier* Lexer<LChar>::makeIdentifierSameType(const UChar* characters, size_t length) +{ + return &m_arena->makeIdentifierLCharFromUChar(m_globalData, characters, length); +} + +template <> +ALWAYS_INLINE const Identifier* Lexer<UChar>::makeIdentifierSameType(const UChar* characters, size_t length) +{ + return &m_arena->makeIdentifier(m_globalData, characters, length); +} + +template <> ALWAYS_INLINE void Lexer<LChar>::setCodeStart(const StringImpl* sourceString) { ASSERT(sourceString->is8Bit()); @@ -259,6 +274,18 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeIdentifierLCharFromUChar(const UCh } template <typename T> +ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const LChar* characters, size_t length) +{ + return &m_arena->makeIdentifier(m_globalData, characters, length); +} + +template <typename T> +ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const UChar* characters, size_t length) +{ + return &m_arena->makeIdentifierLCharFromUChar(m_globalData, characters, length); +} + +template <typename T> ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData, JSTokenLocation* tokenLocation, unsigned lexerFlags, bool strictMode) { ASSERT((lexerFlags & LexerFlagsIgnoreReservedWords)); @@ -293,7 +320,7 @@ ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData, if (lexerFlags & LexexFlagsDontBuildKeywords) tokenData->ident = 0; else - tokenData->ident = makeIdentifier(start, ptr - start); + tokenData->ident = makeLCharIdentifier(start, ptr - start); tokenLocation->line = m_lineNumber; tokenLocation->startOffset = start - m_codeStart; tokenLocation->endOffset = currentOffset(); |