Use correct key-arg splitting 25/94125/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Dec 2020 21:27:30 +0000 (22:27 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 9 Dec 2020 18:26:01 +0000 (19:26 +0100)
commit19c7b05056819a88f9648e6c16b22dd5e61bb364
tree2f9b26b998d14f61afbc0201b75719a7c01d3607
parentee33b303543e94fb5b41be5050c51b3d89929d00
Use correct key-arg splitting

The splitter we have operates on spaces and trims results to get
rid of whitespace -- probably as a consequence of us historically
having bugs there.

We currently break if someone uses double-quoted whitespace trimming,
as we do not treat '\n' as a separator and then attempt to interpret
it as a node-identifier.

Add an explicit SEP equivalent CharMatcher and use a Splitter on that,
resulting in '\t' and '\n' being correctly trimmed.

JIRA: YANGTOOLS-1200
Change-Id: Ifa3085fffcbbe24204e9d6c0d86ed8c41bd61065
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5fe0d9e2a63cc9cf3be8c39f32305cf9e2a8be4e)
yang/yang-parser-antlr/src/main/antlr4/org/opendaylight/yangtools/yang/parser/antlr/YangStatementLexer.g4
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/KeyStatementSupport.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT1200Test.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/YT1200/foo.yang [new file with mode: 0644]