
[...]
I have no clue how important it is to maintain bugward compatibility since I have no clue if anyone is using these output formats. On the other hand, if we do not provide the old range, apps might believe there is no range defined at all.
The only app that I'm aware of that uses this is the libsmi2pysnmp utility from PySNMP (4.x), but I assume there are probably others.
Another alternative could be to generate a range which is less strict, that is for [1:1] and [8:8] we could spit out [1:8] which might be better than generating just [8:8]. (Note that libsmi ensures that ranges are in ascending order if I recall correctly, regardless how things were defined in the MIB module.)
That's very similar to how I had been "fixing" the problem previously. For the few clauses where it mattered, I was simply changing SIZE(x|y) to SIZE(x..y). This allowed smidump to create a single range as you described above.
Even though that solution gives better results than before, it's still not correct. I think the list of ranges that I proposed is the best solution, since there is no loss of information.
--randy