Bug 6180 - Parser: Backslash double-quote in double-quoted string not recognized 28/41828/13
authorPeter Kajsa <pkajsa@cisco.com>
Thu, 14 Jul 2016 10:46:14 +0000 (12:46 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 29 Jul 2016 11:48:23 +0000 (11:48 +0000)
commitb19c4e0ee11ed3ef3d8eee0315621740cc1dfc67
treee3726db128d04b4bb987d3ee82c4dc947828a8cd
parent746a859fcc4538e7ad2fcc8b51e8ff126206c829
Bug 6180 - Parser: Backslash double-quote in double-quoted string not recognized

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>
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]