We could make a nicer method to check for here. `require` will throw an "IllegalArgumentException: requirement failed", which looks kind of weird. We could throw one that says "expected ] at end of input" or similar.