Martin Bjorklund <[email protected]> writes:
> Do you have an suggestion for what to write? These kinds of
> multi-line strings are almost always 'description' statements,
> used for human consumption. It is not clear to me what the warning
> would be.
>> So you can't write an isolated CR in most of a Yang module. But am I
>> correct in understanding that you *can* write an isolated CR inside a
>> single-quoted string (and presumably, a double-quoted string)?
>
> Yes.
I think all of this could be summarized well by putting a paragraph that
tells everything about line ends in Yang at the end of section 6.
Section 6 already deals with the valid characaters for Yang, how they're
encoded, etc.
Lines in a YANG module may end with a carriage return-line feed
combination or with a line feed alone. A carriage return that is not
followed by a line feed may only appear inside a quoted string. Note
that carriage returns and line feeds that appear inside quoted strings
become part of the value of the string without modification; the value
of a multi-line quoted string contains the same form of line ends as
those lines of the YANG module.
In a way, that doesn't add much to the specification. As I think you
said, "Line ends aren't special in Yang." But it does spell out exactly
when CR and LF can be used, and it warns readers against misleading
analogies from other programming languages (where line ends usually are
special).
Dale
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod