diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/JavaScriptCore/parser/Parser.h | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/JavaScriptCore/parser/Parser.h')
-rw-r--r-- | Source/JavaScriptCore/parser/Parser.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h index c2a11d665..79a95b696 100644 --- a/Source/JavaScriptCore/parser/Parser.h +++ b/Source/JavaScriptCore/parser/Parser.h @@ -502,18 +502,18 @@ private: ALWAYS_INLINE void next(unsigned lexerFlags = 0) { - m_lastLine = m_token.m_info.line; - m_lastTokenEnd = m_token.m_info.endOffset; + m_lastLine = m_token.m_location.line; + m_lastTokenEnd = m_token.m_location.endOffset; m_lexer->setLastLineNumber(m_lastLine); - m_token.m_type = m_lexer->lex(&m_token.m_data, &m_token.m_info, lexerFlags, strictMode()); + m_token.m_type = m_lexer->lex(&m_token.m_data, &m_token.m_location, lexerFlags, strictMode()); } ALWAYS_INLINE void nextExpectIdentifier(unsigned lexerFlags = 0) { - m_lastLine = m_token.m_info.line; - m_lastTokenEnd = m_token.m_info.endOffset; + m_lastLine = m_token.m_location.line; + m_lastTokenEnd = m_token.m_location.endOffset; m_lexer->setLastLineNumber(m_lastLine); - m_token.m_type = m_lexer->lexExpectIdentifier(&m_token.m_data, &m_token.m_info, lexerFlags, strictMode()); + m_token.m_type = m_lexer->lexExpectIdentifier(&m_token.m_data, &m_token.m_location, lexerFlags, strictMode()); } ALWAYS_INLINE bool nextTokenIsColon() @@ -541,20 +541,25 @@ private: ALWAYS_INLINE int tokenStart() { - return m_token.m_info.startOffset; + return m_token.m_location.startOffset; } ALWAYS_INLINE int tokenLine() { - return m_token.m_info.line; + return m_token.m_location.line; } ALWAYS_INLINE int tokenEnd() { - return m_token.m_info.endOffset; + return m_token.m_location.endOffset; } - const char* getTokenName(JSTokenType tok) + ALWAYS_INLINE const JSTokenLocation& tokenLocation() + { + return m_token.m_location; + } + + const char* getTokenName(JSTokenType tok) { switch (tok) { case NULLTOKEN: @@ -1003,8 +1008,11 @@ PassRefPtr<ParsedNode> Parser<LexerType>::parse(JSGlobalObject* lexicalGlobalObj RefPtr<ParsedNode> result; if (m_sourceElements) { + JSTokenLocation location; + location.line = m_lexer->lastLineNumber(); + location.column = m_lexer->currentColumnNumber(); result = ParsedNode::create(&lexicalGlobalObject->globalData(), - m_lexer->lastLineNumber(), + location, m_sourceElements, m_varDeclarations ? &m_varDeclarations->data : 0, m_funcDeclarations ? &m_funcDeclarations->data : 0, @@ -1012,7 +1020,7 @@ PassRefPtr<ParsedNode> Parser<LexerType>::parse(JSGlobalObject* lexicalGlobalObj *m_source, m_features, m_numConstants); - result->setLoc(m_source->firstLine(), m_lastLine); + result->setLoc(m_source->firstLine(), m_lastLine, m_lexer->currentColumnNumber()); } else if (lexicalGlobalObject) { // We can never see a syntax error when reparsing a function, since we should have // reported the error when parsing the containing program or eval code. So if we're |