Correct instance-identifier escaping 10/103910/7
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 3 Jan 2023 15:39:04 +0000 (16:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 3 Jan 2023 22:39:33 +0000 (23:39 +0100)
commit45e8951a576c6bf2cb2bd0290167619b8be2fc5a
tree02b18fc16c09a4e53cafe89ed59f538ff1c87f34
parent9eda34f44f1fc1027c357ad02923484e16b6ac0c
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>
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]