Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Target] Improve string interpretation in Target creation #12152

Merged
merged 1 commit into from
Jul 27, 2022
Merged

[Target] Improve string interpretation in Target creation #12152

merged 1 commit into from
Jul 27, 2022

Commits on Jul 21, 2022

  1. [Target] Improve string interpretation in Target creation

    - 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} } }
    Krzysztof Parzyszek committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    92c29e8 View commit details
    Browse the repository at this point in the history