code: private ExtensionsElement readExtensions(String documentation) {
      int start = readInt(); // Range start.
      int end = start;
      if (peekChar() != ';') {
        if (!"to".equals(readWord())) throw unexpected("expected ';' or 'to'");
        String s = readWord(); // Range end.
        if (s.equals("max")) {
          end = ProtoFile.MAX_TAG_VALUE;
        } else {
          end = Integer.parseInt(s);
        }
      }
      if (readChar() != ';') throw unexpected("expected ';'");
      return ExtensionsElement.create(start, end, documentation);
    }
docs: Reads extensions like "extensions 101;" or "extensions 101 to max;".