Ignore:
Timestamp:
Jun 13, 2011, 3:46:21 PM (14 years ago)
Author:
[email protected]
Message:

2011-06-13 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Fix llocp and lvalp names in the lexer to something more meaningful
https://bugs.webkit.org/show_bug.cgi?id=62605

A simple rename

  • parser/Lexer.cpp: (JSC::Lexer::parseIdentifier): (JSC::Lexer::parseString): (JSC::Lexer::lex):
  • parser/Lexer.h: (JSC::Lexer::lexExpectIdentifier):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Lexer.cpp

    r88719 r88724  
    406406}
    407407
    408 template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer::parseIdentifier(JSTokenData* lvalp, unsigned lexType)
     408template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer::parseIdentifier(JSTokenData* tokenData, unsigned lexType)
    409409{
    410410    const ptrdiff_t remaining = m_codeEnd - m_code;
    411411    if ((remaining >= maxTokenLength) && !(lexType & IgnoreReservedWords)) {
    412         JSTokenType keyword = parseKeyword<shouldCreateIdentifier>(lvalp);
     412        JSTokenType keyword = parseKeyword<shouldCreateIdentifier>(tokenData);
    413413        if (keyword != IDENT) {
    414             ASSERT((!shouldCreateIdentifier) || lvalp->ident);
     414            ASSERT((!shouldCreateIdentifier) || tokenData->ident);
    415415            return keyword;
    416416        }
     
    458458
    459459        ident = makeIdentifier(identifierStart, identifierLength);
    460         lvalp->ident = ident;
     460        tokenData->ident = ident;
    461461    } else
    462         lvalp->ident = 0;
     462        tokenData->ident = 0;
    463463
    464464    m_delimited = false;
     
    479479}
    480480
    481 template <bool shouldBuildStrings> ALWAYS_INLINE bool Lexer::parseString(JSTokenData* lvalp, bool strictMode)
     481template <bool shouldBuildStrings> ALWAYS_INLINE bool Lexer::parseString(JSTokenData* tokenData, bool strictMode)
    482482{
    483483    int stringQuoteCharacter = m_current;
     
    575575        m_buffer16.append(stringStart, currentCharacter() - stringStart);
    576576    if (shouldBuildStrings)
    577         lvalp->ident = makeIdentifier(m_buffer16.data(), m_buffer16.size());
     577        tokenData->ident = makeIdentifier(m_buffer16.data(), m_buffer16.size());
    578578    else
    579         lvalp->ident = 0;
     579        tokenData->ident = 0;
    580580
    581581    m_buffer16.resize(0);
     
    753753}
    754754
    755 JSTokenType Lexer::lex(JSTokenData* lvalp, JSTokenInfo* llocp, unsigned lexType, bool strictMode)
     755JSTokenType Lexer::lex(JSTokenData* tokenData, JSTokenInfo* tokenInfo, unsigned lexType, bool strictMode)
    756756{
    757757    ASSERT(!m_error);
     
    10081008        break;
    10091009    case CharacterOpenBrace:
    1010         lvalp->intValue = currentOffset();
     1010        tokenData->intValue = currentOffset();
    10111011        shift();
    10121012        token = OPENBRACE;
    10131013        break;
    10141014    case CharacterCloseBrace:
    1015         lvalp->intValue = currentOffset();
     1015        tokenData->intValue = currentOffset();
    10161016        m_delimited = true;
    10171017        shift();
     
    10281028        shift();
    10291029        if ((m_current | 0x20) == 'x' && isASCIIHexDigit(peek(1))) {
    1030             parseHex(lvalp->doubleValue);
     1030            parseHex(tokenData->doubleValue);
    10311031            token = NUMBER;
    10321032        } else {
    10331033            record8('0');
    10341034            if (isASCIIOctalDigit(m_current)) {
    1035                 if (parseOctal(lvalp->doubleValue)) {
     1035                if (parseOctal(tokenData->doubleValue)) {
    10361036                    if (strictMode)
    10371037                        goto returnError;
     
    10431043    case CharacterNumber:
    10441044        if (LIKELY(token != NUMBER)) {
    1045             if (!parseDecimal(lvalp->doubleValue)) {
     1045            if (!parseDecimal(tokenData->doubleValue)) {
    10461046                if (m_current == '.') {
    10471047                    shift();
     
    10541054                // Null-terminate string for strtod.
    10551055                m_buffer8.append('\0');
    1056                 lvalp->doubleValue = WTF::strtod(m_buffer8.data(), 0);
     1056                tokenData->doubleValue = WTF::strtod(m_buffer8.data(), 0);
    10571057            }
    10581058            token = NUMBER;
     
    10671067    case CharacterQuote:
    10681068        if (lexType & DontBuildStrings) {
    1069             if (UNLIKELY(!parseString<false>(lvalp, strictMode)))
     1069            if (UNLIKELY(!parseString<false>(tokenData, strictMode)))
    10701070                goto returnError;
    10711071        } else {
    1072             if (UNLIKELY(!parseString<true>(lvalp, strictMode)))
     1072            if (UNLIKELY(!parseString<true>(tokenData, strictMode)))
    10731073                goto returnError;
    10741074        }
     
    10821082    case CharacterBackSlash:
    10831083        if (lexType & DontBuildKeywords)
    1084             token = parseIdentifier<false>(lvalp, lexType);
     1084            token = parseIdentifier<false>(tokenData, lexType);
    10851085        else
    1086             token = parseIdentifier<true>(lvalp, lexType);
     1086            token = parseIdentifier<true>(tokenData, lexType);
    10871087        break;
    10881088    case CharacterLineTerminator:
     
    11191119
    11201120returnToken:
    1121     llocp->line = m_lineNumber;
    1122     llocp->startOffset = startOffset;
    1123     llocp->endOffset = currentOffset();
     1121    tokenInfo->line = m_lineNumber;
     1122    tokenInfo->startOffset = startOffset;
     1123    tokenInfo->endOffset = currentOffset();
    11241124    m_lastToken = token;
    11251125    return token;
Note: See TracChangeset for help on using the changeset viewer.