VirtualBox

Changeset 72293 in vbox for trunk/src


Ignore:
Timestamp:
May 23, 2018 10:08:39 AM (7 years ago)
Author:
vboxsync
Message:

CUE: Fixed REM keyword parsing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/CUE.cpp

    r67874 r72293  
    312312DECLINLINE(void) cueTokenizerSkipCh(PCUETOKENIZER pTokenizer)
    313313{
    314     pTokenizer->pszInput++;
     314    /* Never ever go past EOS. */
     315    if (!cueTokenizerIsEos(pTokenizer))
     316        pTokenizer->pszInput++;
    315317}
    316318
     
    383385
    384386/**
     387 * Skip all whitespace starting from the current input buffer position.
     388 * Skips all present comments too.
     389 *
     390 * @returns nothing.
     391 * @param   pTokenizer    The tokenizer state.
     392 */
     393DECLINLINE(void) cueTokenizerSkipWhitespace(PCUETOKENIZER pTokenizer)
     394{
     395    while (!cueTokenizerIsEos(pTokenizer))
     396    {
     397        while (   cueTokenizerGetCh(pTokenizer) == ' '
     398               || cueTokenizerGetCh(pTokenizer) == '\t')
     399            cueTokenizerSkipCh(pTokenizer);
     400
     401        if (   !cueTokenizerIsEos(pTokenizer)
     402            && !cueTokenizerIsSkipNewLine(pTokenizer))
     403            break; /* Skipped everything, next is some real content. */
     404    }
     405}
     406
     407/**
    385408 * Skips a multi line comment.
    386409 *
     
    393416           && !cueTokenizerIsSkipNewLine(pTokenizer))
    394417        cueTokenizerSkipCh(pTokenizer);
    395 }
    396 
    397 /**
    398  * Skip all whitespace starting from the current input buffer position.
    399  * Skips all present comments too.
    400  *
    401  * @returns nothing.
    402  * @param   pTokenizer    The tokenizer state.
    403  */
    404 DECLINLINE(void) cueTokenizerSkipWhitespace(PCUETOKENIZER pTokenizer)
    405 {
    406     while (!cueTokenizerIsEos(pTokenizer))
    407     {
    408         while (   cueTokenizerGetCh(pTokenizer) == ' '
    409                || cueTokenizerGetCh(pTokenizer) == '\t')
    410             cueTokenizerSkipCh(pTokenizer);
    411 
    412         if (   !cueTokenizerIsEos(pTokenizer)
    413             && !cueTokenizerIsSkipNewLine(pTokenizer))
    414             break; /* Skipped everything, next is some real content. */
    415     }
     418    cueTokenizerSkipWhitespace(pTokenizer);
    416419}
    417420
     
    428431    unsigned cchKeyword = 0;
    429432    bool fIsKeyword = false;
    430     bool fIsComment = false;
    431     const char *pszKeyword = pTokenizer->pszInput;
    432 
    433     Assert(RT_C_IS_ALPHA(*pszKeyword));
     433    bool fIsComment;
     434    const char *pszKeyword;
     435
     436    Assert(RT_C_IS_ALPHA(*pTokenizer->pszInput));
    434437
    435438    do
    436439    {
    437440        fIsComment = false;
     441        pszKeyword = pTokenizer->pszInput;
    438442
    439443        do
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette