expect method

void expect(
  1. String expectedChar
)

Implementation

void expect(String expectedChar) {
  if (next().toLowerCase() != expectedChar.toLowerCase()) {
    throw Exception('Expected $expectedChar');
  }
}