whileLoopStmt method
Implementation
Stmt whileLoopStmt() {
final token = consume(TokenType.kWhile, 'Expected "while" keyword.');
final expr = math();
consume(TokenType.kDo, 'Expected while-loop to begin with "do" keyword.');
final body = bodyStmt(terminal: TokenType.kEnd);
consume(
TokenType.kEnd,
'Expected while-loop to terminate with "end" keyword.',
);
return WhileLoopStmt(token, expr: expr, body: body);
}