Subject: [netmod] comments

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 29 Dec 2015 10:09:11 +0100

Hi,

I propose the following change to sec. 14 in 6020bis (third paragraph):

OLD
   This grammar assumes that the scanner replaces YANG comments with a
   single space character.

NEW
   This grammar assumes that the scanner replaces YANG comments outside
   quoted arguments with a single space character.

I think it would be useful to mention this substitution also in sec 6.1.1.

Lada 

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

---

From: Andy Bierman <[email-masked]>
Date: Tue, 29 Dec 2015 08:47:56 -0800

>    quoted arguments with a single space character.

A comment inside a quoted string is not a YANG comment.
It is just part of a string that happens to look like a comment.

Andy

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

---

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 29 Dec 2015 17:53:24 +0100

> On 29 Dec 2015, at 17:47, Andy Bierman <[email-masked]> wrote:
> 
> 
> 

As far as I can tell, this is not clear from the text.

Lada

---

From: Christian Hopps <[email-masked]>
Date: Tue, 29 Dec 2015 12:42:15 -0500

> As far as I can tell, this is not clear from the text.

Doesn't the new text actually imply that YANG comments exist inside
quoted arguments?

Thanks,
Chris.

---

From: Andy Bierman <[email-masked]>
Date: Tue, 29 Dec 2015 10:07:47 -0800

> Doesn't the new text actually imply that YANG comments exist inside

The NEW text is wrong.

6.3.  Statements

   A YANG module contains a sequence of statements.  Each statement
   starts with a keyword, followed by zero or one argument, followed
   either by a semicolon (";") or a block of substatements enclosed
   within braces ("{ }"):

     statement = keyword [argument] (";" / "{" *statement "}")

   The argument is a string, as defined in Section 6.1.2.

This seems clear to me that any characters interpreted to be part of
[argument]
are not interpreted as a comment.  A quoted string as [argument] is taken
in its entirety as part of a YANG statement.

Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 30 Dec 2015 08:32:11 +0100

> Doesn't the new text actually imply that YANG comments exist inside

You are right, it is misleading. It would be better to add a sentence
like this to sec. 6.1.1:

NEW
   Inside an argument, the above character pairs are never interpreted
   as the start or end of a comment.

For example, Python spec also says this:

A comment starts with a hash character (#) that is not part of a string
literal, …

Lada

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 30 Dec 2015 08:42:50 +0100

> in its entirety as part of a YANG statement.

The distinction between whitespace separators inside and outside
arguments is blurred by the fact that the ABNF has production rules for
arguments that use the same non-terminals representing whitespace as
statement-level productions. For example,

   key-stmt            = key-keyword sep key-arg-str stmtend

and then

   key-arg             = node-identifier *(sep node-identifier)

A comment is valid as the "sep" in the former case but not in the
latter.

Lada