Subject: [netmod] YANG 1.1 range-stmt

From: Andy Bierman <[email-masked]>
Date: Fri, 3 Feb 2017 15:46:36 -0800

Hi,

I noticed a new difference between our YANG compiler and pyang.

   leaf X {
     type int8;
     range "1 .. 1";
   }

pyang says this is an error:

error: range error: "1" is not larger than "1"

yangdump-pro does not issue any error or warning.

I cannot find any text in sec. 9.2.4 that says the upper bound must be
greater than the lower bound in a range-part

Which compiler is correct?

thanks,
Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 06 Feb 2017 08:55:25 +0100 (CET)

> Which compiler is correct?

Unclear.  It is not even clear that range "1 .. 0" is an error.

Not surprisingly, I would argue that "1 .. 1" was intended to be
illegal, since we have a special syntax for this case, i.e., "1".

/martin

---

From: Robert Wilton <[email-masked]>
Date: Mon, 6 Feb 2017 10:09:46 +0000

> illegal, since we have a special syntax for this case, i.e., "1".
Certainly "1" seems to be the canonical form.

Note, that similar conditions also occur when you consider min and max.

E.g.

    leaf X {
      type uint8;
      range "min .. 0";
    }

Rob

>
>
> /martin
>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
> .
>