Subject: [netmod] whitespace characters

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 28 Dec 2015 09:23:35 +0100

Hi,

the definition of "enum" argument (sec. 9.6.4 in 6020bis) says:

   The string MUST NOT be empty and MUST NOT have any leading or trailing
   whitespace characters.

It is not clear what "whitespace character" means. The ABNF indicates this:

   WSP                 = SP / HTAB
                         ; whitespace

I think in the "enum" definition LF (and maybe also CR?) should also count as a whitespace character.

Lada

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: Randy Presuhn <[email-masked]>
Date: Wed, 30 Dec 2015 14:38:14 -0800 (GMT-08:00)

Hi -

>From: Ladislav Lhotka <[email-masked]>
>Sent: Dec 30, 2015 1:22 PM
>To: Randy Presuhn <[email-masked]>
>Cc: NETMOD WG <[email-masked]>
>Subject: Re: [netmod] whitespace characters
>
>
>> On 30 Dec 2015, at 20:07, Randy Presuhn <[email-masked]> wrote:
>> 
>> Hi -
>> 
>>> From: Ladislav Lhotka <[email-masked]>
>>> Sent: Dec 30, 2015 12:19 AM
>>> To: Randy Presuhn <[email-masked]>, NETMOD WG <[email-masked]>
>>> Subject: Re: [netmod] whitespace characters
>>> 
>>> Randy Presuhn <[email-masked]> writes:
>>> 
>>>> Hi -
>>>> 
>>>> This got me thinking - would "U+202A U+202B" thus be a valid
>>>> argument, distinct from, say, "U+202B U+202A"?
>>> 
>>> IMO they should be distinct. For "string" type, sec. 9.4.2 in 6020bis
>>> says that no Unicode normalization is performed. The same should
>>> probably be stated for string literals appearing in YANG modules.
>> 
>> Even given the semantics of U+202A (left-to-right embedding)?
>> I understand why they make a difference for strings in general,
>> but in an enum argument, cases like this seem rather pathological.
>
>Honestly, I don't know, this seems rather pathological in any case.
>I just checked programming languages that claim to have decent
>Unicode handling (Python 3, Haskell), and both consider those
>two strings non-equal. 

As *strings* they should indeed be non-equal.

As enum arguments, it seems less clear.  Is the whole point of
limiting leading and trailing whitespace merely a matter of
avoiding a pathology in the grammar, or is it actually connected
to human factors concerns?  If it's the former, then things like
LRE are a non-issue.  If it's the latter, then there's a potential
problem.

Randy