expect method
Implementation
LatexToken expect(String type, [String? message]) {
final token = peek();
if (token == null) {
throw Exception(message ?? "期望 $type,但到达文件末尾");
}
advance();
return token;
}
LatexToken expect(String type, [String? message]) {
final token = peek();
if (token == null) {
throw Exception(message ?? "期望 $type,但到达文件末尾");
}
advance();
return token;
}