[YANGTOOLS-1458] Instance identifier parser : handle inner quotes within quoted strings Created: 25/Oct/22  Updated: 09/Jan/23  Resolved: 09/Jan/23

Status: Resolved
Project: yangtools
Component/s: xpath
Affects Version/s: None
Fix Version/s: 8.0.10, 10.0.3, 9.0.7

Type: Bug Priority: Medium
Reporter: Ruslan Kashapov Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to YANGTOOLS-1473 XML/JSON YangInstanceIdentifier codec... Resolved
relates to YANGTOOLS-1361 YangXPathExpression.interpretAsInstan... Resolved

 Description   

actual: 
node identifier with predicates containing literals with quotes cannot be recognized properly
examples:

"/foo:foo[. = 'i\'am']"
"/foo:foo[foo:bar = \"quot\\\"ed\"]";

expected:

escaped quotes should be treated as part of quoted string



 Comments   
Comment by Robert Varga [ 25/Oct/22 ]

The first is actually not valid: YANG does not allow escaping inside single-quoted strings (see https://www.rfc-editor.org/rfc/rfc7950#section-6.1.3).

The second is valid, though and will require some surgery to switch to modal lexer – just like we have for YANG itself

Generated at Wed Feb 07 20:56:12 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.