Extend string parser to understand full Python string literal syntax
!919 (merged) showed that the current string parser can only understand escaped string delimiters, making it impossible to use Python repr
to map a string value to a string literal that the JobOptionsSvc can understand.
While the current workaround ('"%s"' % value.replace('"', '\\"')
) works for string values, it will fail for e.g. list of strings, because for them we use repr
.
It actually not needed to support the full spectrum of Python string literals: it's enough to understand the subset used by repr
to format the return value.