nokia / ntt

Modern tools for TTCN-3
https://nokia.github.io/ntt/
BSD 3-Clause "New" or "Revised" License
71 stars 33 forks source link

Support ranged enumeration values #638

Closed 5nord closed 1 year ago

5nord commented 2 years ago

Support enumerated labels which represent multiple values.

Example from the standard:

type enumerated MyThirdEnumType {
    Blue(0),
    Yellow(1),
    Green(3),
    Other(2, 4..255)
}

_Originally posted by @5nord in https://github.com/nokia/ntt/pull/637#discussion_r984249376_

UrbanskiDawid commented 1 year ago

this is already supported:

        {`type enumerated MyThirdEnumType {Blue(0),Yellow(1),Green(3),Other(2, 4..255)}; MyThirdEnumType`,
            NewEnumTypeWithIds(
                "MyThirdEnumType",
                "Blue", []runtime.EnumRange{{First: 0, Last: 0}},
                "Yellow", []runtime.EnumRange{{First: 1, Last: 1}},
                "Green", []runtime.EnumRange{{First: 3, Last: 3}},
                "Other", []runtime.EnumRange{{First: 2, Last: 2}, {First: 4, Last: 255}},
            ),
        },

passes

5nord commented 1 year ago

Implemented in #637