-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Target] Improve string interpretation in Target creation (#12152)
- SplitString now preserves escape sequences, but still observes quote characters. - Added function Interpret that transforms given string according to interpretation rules: - outermost quotes are removed (if present), - escape sequences inside quotes are preserved verbatim, - unquoted escape sequences produce the escaped character (the escape character (\) is removed. - Interpretation happens every time a value of any type is to be parsed from a string, e.g. Array<String> will first be parsed as an array, then substrings of the input will be parsed as individual elements of that array. In this case, some parts of the initial input will be parsed (and interpreted) twice. - Implement corresponding stringification functionality. This new scheme enabled encoding nested arrays of string with any degree of nesting. For example "-field='\\'foo0\\',\\'bar0,bar1\\'','\\'zing0,zing1\\',\\'fred\\''" would correspond to the target kind attribute Array<Array<Array<String>>>("field")) and have the value { { {foo0}, {bar0, bar1} }, { {zing0, zing1}, {fred} } }
- Loading branch information
Krzysztof Parzyszek
authored
Jul 27, 2022
1 parent
465b579
commit 7b6cb60
Showing
2 changed files
with
274 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.