From c23ff6173ba5ff4280df8ae9d1131163793630da Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 3 Jan 2023 20:25:10 +0100 Subject: [PATCH] Force instanceIdentifier to consume all input We need ANTLR to completely process the input string, hence force an EOF token in instanceIdentifier. JIRA: YANGTOOLS-1361 Change-Id: I80f1b326a47857e4e8f36c568901d19f771cef96 Signed-off-by: Robert Varga (cherry picked from commit 9eda34f44f1fc1027c357ad02923484e16b6ac0c) --- .../yangtools/yang/xpath/antlr/instanceIdentifier.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 b/xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 index 200130599b..389cc44376 100644 --- a/xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 +++ b/xpath/yang-xpath-impl/src/main/antlr4/org/opendaylight/yangtools/yang/xpath/antlr/instanceIdentifier.g4 @@ -10,7 +10,7 @@ grammar instanceIdentifier; * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -instanceIdentifier : ('/' pathArgument)+ +instanceIdentifier : ('/' pathArgument)+ EOF ; pathArgument : nodeIdentifier predicate? -- 2.36.6