Bug 6180 - Parser: Backslash double-quote in double-quoted string not recognized 90/44490/3
authorVratko Polak <vrpolak@cisco.com>
Mon, 22 Aug 2016 13:23:19 +0000 (15:23 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 6 Sep 2016 10:22:12 +0000 (10:22 +0000)
commit5310106cd4db53a3033a085ff95545d4a2841db4
treebfb281cfffcc27d1b5c34f9f30aa2903b6bc3da3
parent75c484d83489bb183af2cd61a02d4a82412efdf2
Bug 6180 - Parser: Backslash double-quote in double-quoted string not recognized

This is a simplistic cherry-pick from Boron:

Statement parser removes all double or single quotes from strings,
what is incorrect. This fix removes only first and last quotes if they are
present. All other quotes in the string should be escaped already, since the
ANTLR parser recognizes only correctly enclosed strings.

Further, substitution of backslash-escaped characters in
double-quoted strings is done.

Change-Id: I2f596c73be05178dc5cbebaed12e25e428454219
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6180Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6180/double-quotes-single-inside.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6180/double-quotes.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6180/single-quotes.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug6180/string-test.yang [new file with mode: 0644]