Use correct key-arg splitting 17/94117/2
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 15:14:17 +0000 (16:14 +0100)
commit5fe0d9e2a63cc9cf3be8c39f32305cf9e2a8be4e
treecdd34cfa3e8da292c976549b95c2bfc8d9ea6d1c
parent3cb21f96c1d8b5b22dc948a2c016180cb2456fc8
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>
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]