Use correct key-arg splitting 26/94126/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:14 +0000 (19:26 +0100)
commit021c7a7428dd6d28ba97a946ccc1a13dc9d5a031
tree246ca04f45e0d0ffe9fd6248472d4101bc85ae89
parent224f05957b7d9952f17132c47e64e83de6abc383
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]