mirror of
https://github.com/RGBCube/serenity
synced 2026-01-13 00:41:00 +00:00
A quite common semantic emerged for parsing comma-separated expressions:
consume(TokenType::ParenOpen);
do {
// do something
if (!match(TokenType::Comma))
break;
consume(TokenType::Comma);
} while (!match(TokenType::Eof));
consume(TokenType::ParenClose);
Add a helper to do the bulk of the while loop.
|
||
|---|---|---|
| .. | ||
| Tests | ||
| AST.h | ||
| CMakeLists.txt | ||
| Forward.h | ||
| Lexer.cpp | ||
| Lexer.h | ||
| Parser.cpp | ||
| Parser.h | ||
| Token.cpp | ||
| Token.h | ||