Correct instance-identifier escaping 57/103957/4
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 3 Jan 2023 15:39:04 +0000 (16:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 7 Jan 2023 19:07:28 +0000 (20:07 +0100)
commit97ac0c85df3eb2ebc77c7f8b25cdada41718cdb1
tree37cc3805a69cb58fad802b074d301e144d4e71ef
parentc23ff6173ba5ff4280df8ae9d1131163793630da
Correct instance-identifier escaping

Dealing with single-quoted and double-quoted strings in
instance-identifier differs quite a bit. In order to deal with these
strings, we need to differentiate them in lexer, for which we create
separate modes.

This forces us to explicitly define lexer lokens and only match raw
strings in their mode -- ensuring there are no surprises.

JIRA: YANGTOOLS-1458
Change-Id: I3f58c10f068da1128d8a7c1c5bed3917bfea0c78
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 45e8951a576c6bf2cb2bd0290167619b8be2fc5a)
xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifierLexer.g4 [moved from xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 with 51% similarity]
xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifierParser.g4 [new file with mode: 0644]
xpath/yang-xpath-impl/src/main/java/org/opendaylight/yangtools/yang/xpath/impl/InstanceIdentifierParser.java
xpath/yang-xpath-impl/src/test/java/org/opendaylight/yangtools/yang/xpath/impl/InstanceIdentifierParserTest.java [new file with mode: 0644]