Subject: [netmod] Handling of \ in double quoted strings

From: Paul Borman <[email-masked]>
Date: Fri, 13 Feb 2015 10:20:36 -0800

RFC6020 is very clear about the meaning of \n, \t, \\, and \" in a double
quoted string, but it is silent on what the special character \s means.
What should the following 6 lines mean?

pattern "\s";
pattern "\\s";
pattern "\\\\s";

description "\s";
description "\\s";
description "\\\\s";

I have noticed that normally a single quote is used for patterns, but at
times double quotes have been used.  It appears that the assertion by this
code is that "\s" and "\\s" are the same thing, meaning the regex pattern
to match a backslash followed by an s, using double quotes, must be "\\\\s".

The file ietf-ipfix-psamp.yang contains backslashed patterns using double
quotes assuming the backslash will (sometimes) pass through the scanner
rather than be consumed as part of a special character.

Thanks,

    -Paul

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 13 Feb 2015 19:27:04 +0100

Hi,

this problem will be addressed in YANG 1.1, see issue Y06 "escaped
characters in double quoted strings". New text is already in Section
6.1.3 of draft-ietf-netmod-rfc6020bis-03.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>