syntax = "proto2";

package test;

message M {
    optional int32 y0 = 1;
    optional int32 y1 = 2;
    optional int32 y2 = 3;
    optional int32 y3 = 4;
    optional int32 y4 = 5;

    reserved 2, 3 to 3, 5 to 10;
    reserved 7, 8 to max;   // Overlapping reserved regions.
    reserved max to max;    // Only first can be max.

    optional int32 reserved = 100;
    reserved "reserved", "unused";
}

enum E {
    Y0 = 1;
    Y1 = 2;
    Y2 = 3;
    Y3 = 4;
    Y4 = 5;

    reserved 2, 3 to 3, 5 to 10;
    reserved 7, 8 to max;
    reserved max to max;

    reserved = 100;
    reserved "reserved", "unused";
}

enum Z {
    K = 0;
    reserved 0;
}