mirror of https://github.com/x64dbg/btparser
AStyle
This commit is contained in:
parent
87003fef8d
commit
c8ca8305e2
|
@ -94,7 +94,8 @@ bool Lexer::Test(const std::function<void(const std::string & line)> & lexEnum,
|
|||
toks.append(TokString(tok));
|
||||
appendCh(toks, ' ');
|
||||
lexEnum(toks);
|
||||
} while (tok != tok_eof && tok != tok_error);
|
||||
}
|
||||
while(tok != tok_eof && tok != tok_error);
|
||||
if(tok != tok_error && tok != tok_eof)
|
||||
tok = reportError("lexer did not finish at the end of the file");
|
||||
for(const auto & warning : mWarnings)
|
||||
|
@ -314,7 +315,8 @@ Lexer::Token Lexer::getToken()
|
|||
if(mLastChar == '\n')
|
||||
signalNewLine();
|
||||
nextChar();
|
||||
} while (!(mLastChar == EOF || mLastChar == '\n'));
|
||||
}
|
||||
while(!(mLastChar == EOF || mLastChar == '\n'));
|
||||
|
||||
return getToken(); //interpret the next line
|
||||
}
|
||||
|
@ -325,7 +327,8 @@ Lexer::Token Lexer::getToken()
|
|||
if(mLastChar == '\n')
|
||||
signalNewLine();
|
||||
nextChar();
|
||||
} while (!(mLastChar == EOF || mLastChar == '*' && peekChar() == '/'));
|
||||
}
|
||||
while(!(mLastChar == EOF || mLastChar == '*' && peekChar() == '/'));
|
||||
|
||||
if(mLastChar == EOF) //unexpected end of file
|
||||
{
|
||||
|
@ -437,11 +440,16 @@ std::string Lexer::TokString(const TokenState & ts)
|
|||
{
|
||||
switch(ts.Token)
|
||||
{
|
||||
case tok_eof: return "tok_eof";
|
||||
case tok_error: return StringUtils::sprintf("error(line %d, col %d, \"%s\")", ts.CurLine + 1, ts.LineIndex, mError.c_str());
|
||||
case tok_identifier: return ts.IdentifierStr;
|
||||
case tok_number: return StringUtils::sprintf(mIsHexNumberVal ? "0x%llX" : "%llu", ts.NumberVal);
|
||||
case tok_stringlit: return StringUtils::sprintf("\"%s\"", StringUtils::Escape(ts.StringLit).c_str());
|
||||
case tok_eof:
|
||||
return "tok_eof";
|
||||
case tok_error:
|
||||
return StringUtils::sprintf("error(line %d, col %d, \"%s\")", ts.CurLine + 1, ts.LineIndex, mError.c_str());
|
||||
case tok_identifier:
|
||||
return ts.IdentifierStr;
|
||||
case tok_number:
|
||||
return StringUtils::sprintf(mIsHexNumberVal ? "0x%llX" : "%llu", ts.NumberVal);
|
||||
case tok_stringlit:
|
||||
return StringUtils::sprintf("\"%s\"", StringUtils::Escape(ts.StringLit).c_str());
|
||||
case tok_charlit:
|
||||
{
|
||||
std::string s;
|
||||
|
@ -462,11 +470,16 @@ std::string Lexer::TokString(Token tok)
|
|||
{
|
||||
switch(tok)
|
||||
{
|
||||
case tok_eof: return "tok_eof";
|
||||
case tok_error: return StringUtils::sprintf("error(line %d, col %d, \"%s\")", mState.CurLine + 1, mState.LineIndex, mError.c_str());
|
||||
case tok_identifier: return mState.IdentifierStr;
|
||||
case tok_number: return StringUtils::sprintf(mIsHexNumberVal ? "0x%llX" : "%llu", mState.NumberVal);
|
||||
case tok_stringlit: return StringUtils::sprintf("\"%s\"", StringUtils::Escape(mState.StringLit).c_str());
|
||||
case tok_eof:
|
||||
return "tok_eof";
|
||||
case tok_error:
|
||||
return StringUtils::sprintf("error(line %d, col %d, \"%s\")", mState.CurLine + 1, mState.LineIndex, mError.c_str());
|
||||
case tok_identifier:
|
||||
return mState.IdentifierStr;
|
||||
case tok_number:
|
||||
return StringUtils::sprintf(mIsHexNumberVal ? "0x%llX" : "%llu", mState.NumberVal);
|
||||
case tok_stringlit:
|
||||
return StringUtils::sprintf("\"%s\"", StringUtils::Escape(mState.StringLit).c_str());
|
||||
case tok_charlit:
|
||||
{
|
||||
std::string s;
|
||||
|
|
Loading…
Reference in New Issue