Use correct key-arg splitting 27/94127/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:28:20 +0000 (19:28 +0100)
commitb6fe64c866e005ef1549f6775df6aeb5dda0603a
tree027fd9e1b38685e28ca1a057bd76c6ac87487437
parentc81811dc49ee53d611b11a7bd8268314b6e2a413
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]