Subject: Re: [netmod] comments

From: Martin Bjorklund <[email-masked]>
Date: Fri, 08 Jan 2016 09:40:16 +0100 (CET)

Ladislav Lhotka <[email-masked]> wrote:
> 
> > On 29 Dec 2015, at 17:47, Andy Bierman <[email-masked]> wrote:
> > 
> > 
> > 
> > On Tue, Dec 29, 2015 at 1:09 AM, Ladislav Lhotka <[email-masked]> wrote:
> > 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.
> > 
> > 
> > 
> > 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.
> 
> As far as I can tell, this is not clear from the text.

Note that 6.1.3 says:

   If a string contains any space or tab characters, a semicolon (";"),
   braces ("{" or "}"), or comment sequences ("//", "/*", or "*/"), then
   it MUST be enclosed within double or single quotes.

Also, section 14 says:

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

/martin

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 8 Jan 2016 09:57:58 +0100

> On 08 Jan 2016, at 09:40, Martin Bjorklund <[email-masked]> wrote:
> 

Yes, but it doesn't say that comment sequences inside a quoted string are interpreted as literal characters.
In another mail I proposed a simple change to sec. 6.1.1 that would solve this issue:

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

>   This grammar assumes that the scanner replaces YANG comments with a

Yes, as long as it is clear that a comment cannot be inside a quoted argument.

Lada

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

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 08 Jan 2016 11:14:01 +0100 (CET)

Ladislav Lhotka <[email-masked]> wrote:
> Yes, but it doesn't say that comment sequences inside a quoted
> string are interpreted as literal characters.

Ok, I added this clarification.

/martin