[YANGTOOLS-893] YANG parser does not allow newline in unique statement Created: 14/Aug/18  Updated: 16/Aug/18  Resolved: 16/Aug/18

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: 2.0.7
Fix Version/s: 2.1.0, 2.0.11, 2.0.6.2

Type: Bug Priority: Medium
Reporter: Peter Verthez Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive unique.zip    

 Description   

See the attached model.   This model contains a unique statement with a newline:

unique "listkey1
             listkey2";

This produces a parser error in 2.0.7 (it was working in 1.2.3):

Caused by: org.opendaylight.yangtools.yang.parser.spi.source.SourceException: String 'listkey1
listkey2' is not a valid identifier [at /home/verthezp/logs/unique/testmodule.yang:9:4]
at org.opendaylight.yangtools.yang.parser.spi.source.SourceException.throwIf(SourceException.java:99)
at org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils.checkIdentifierString(StmtContextUtils.java:570)
at org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils.parseNodeIdentifier(StmtContextUtils.java:538)
at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.ArgumentUtils.nodeIdentifierFromPath(ArgumentUtils.java:132)
... 43 more

 

According to what I see in the RFC this should be allowed: see the "unique-arg" and "sep" definitions in https://tools.ietf.org/html/rfc6020#section-12 .



 Comments   
Comment by Robert Varga [ 16/Aug/18 ]

The same problem occurs with horizontal tabs, added test cases to cover them.

Generated at Wed Feb 07 20:54:36 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.