code: void endOptional(boolean successful) {
          if (successful) {
              parsed.remove(parsed.size() - 2);
          } else {
              parsed.remove(parsed.size() - 1);
          }
      }
docs: Ends the parsing of an optional segment of the input.
  
  @param successful  whether the optional segment was successfully parsed