Add quoted glob syntax for addressing wildcardless glob round-trip contract violation #50
Labels
No labels
bug
duplicate
enhancement/documentation
enhancement/feature
enhancement/organization
question
rejected
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
UserCurt/mpath#50
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using
DotGlobdirectly in constructing MPath pointers can violate the Pointer string round-trip contract because some dot globs cannot be represented in parsable form.To address this bug, this issue proposes an enhancement feature where quoted strings can have a prefix to specify the string is parsed as a
DotGlob:/"hello world"stays as an exact member/g"hello*world"is a regular glob but quoted/g"hello world"represents a wildcard-free glob/g""would be an empty globIn implementation, the tokenizer should allow a prefix of any length. The parser should accept no prefix for
DotExactandgforDotGlob, where other prefixes should error. This allows for future prefixrfor regular expressions #4.Conversion of
DotGlobto a string should omit the prefixed string representation when unnecessary but useg"..."when there is an absence of wildcards.Character escaping is as expected:
*and?are wildcards.\*and\?are literal characters.\"represents a quote.\\represents a backslash.Implemented in
9a56957as described. It was implemented in such a way that other prefixes can be easily added, such asrfor regular expressions in the future. Round-trip string tests were updated too.