expect method
- String expectedChar
Read a specific character and throw an exception if it's not found
Parameter is case-insensitive
Implementation
void expect(String expectedChar) {
if (next().toLowerCase() != expectedChar.toLowerCase()) {
throw Exception('Expected $expectedChar');
}
}