expect method

void expect(
  1. int char
)

Consumes char at the cursor, otherwise throws FormatException.

Implementation

void expect(int char) {
  if (!tryConsume(char)) {
    throw _error("expected '${String.fromCharCode(char)}'");
  }
}