mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibCpp: Add function for retrieving TODO comments from the parser
Now `get_todo_entries` collects all TODO found within a comment statement.
This commit is contained in:
parent
fcef84c461
commit
c397e030f4
2 changed files with 14 additions and 0 deletions
|
@ -961,6 +961,19 @@ void Parser::print_tokens() const
|
|||
}
|
||||
}
|
||||
|
||||
Vector<String> Parser::get_todo_entries() const
|
||||
{
|
||||
Vector<String> ret;
|
||||
for (auto& token : m_tokens) {
|
||||
if (token.type() == Token::Type::Comment) {
|
||||
if (token.text().contains("TODO")) {
|
||||
ret.append(token.text());
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
NonnullRefPtr<StringLiteral> Parser::parse_string_literal(ASTNode& parent)
|
||||
{
|
||||
ScopeLogger<CPP_DEBUG> logger;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue