public void eatVersionInfo() { if (maybeEatHeaderName("Manifest-Version")) { eatColon(); eatVersionNumber(); eatNewline(); } else { // The problem will have been reported - jump out of here which will // treat this (whatever it is...) as a regular header } }
/** * Expects to eat "Name" ":" "<value>" * @return continue? */ public boolean eatNameAttribute() { boolean cont; if (maybeEatHeaderName("Name")) { eatColon(); Token valueToken = tokenStream.next(); tokenStream.next(); // newline cont = visitor.visitSection(false, valueToken.value()); if (!cont) { return false; } visitor.visitHeader(NAME_HEADER, valueToken.value()); } else { Token token = tokenStream.peek(); // ERROR: they didn't supply a Name. Report an error and treat this // as a regular attribute cont = visitor.visitSection(false, null); // still the start of a // section, just has no // name recordProblem(ManifestProblemKind.MISSING_NAME_HEADER, token.getStartOffset(), token.getEndOffset(), token.value()); } return cont; }