1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibCpp: Add Preprocessor:unprocessed_token()

This commit is contained in:
Itamar 2022-02-05 20:28:05 +02:00 committed by Andreas Kling
parent 4a8afd6b4e
commit bed60b2d49
2 changed files with 6 additions and 0 deletions

View file

@ -24,11 +24,14 @@ Vector<Token> Preprocessor::process_and_lex()
lexer.set_ignore_whitespace(true);
auto tokens = lexer.lex();
m_unprocessed_tokens = tokens;
for (size_t token_index = 0; token_index < tokens.size(); ++token_index) {
auto& token = tokens[token_index];
m_current_line = token.start().line;
if (token.type() == Token::Type::PreprocessorStatement) {
handle_preprocessor_statement(token.text());
m_processed_tokens.append(tokens[token_index]);
continue;
}