export default function expectChars(regex, amount = 1) {
  let remaining = amount;

  return Object.freeze(Object.defineProperties(c => {
    if (!c.match(regex)) {
      remaining = amount;
      return undefined;
    }

    remaining--;
    return remaining > 0;
  }, {
    length: {
      value: amount,
    },
    reset: {
      value: () => {
        remaining = amount;
      },
    },
  }));
}

@@ -365,24 +365,40 @@
 g = amount;%0A
+        return;%0A
       %7D,%0A   

fix a disregarded codestyle rule