Am 06.02.2020 um 20:19 schrieb Allin Cottrell:
On Thu, 6 Feb 2020, Sven Schreiber wrote:
> Am 06.02.2020 um 12:35 schrieb Riccardo (Jack) Lucchetti:
>> <hansl>
>> string sep = $windows ? "\" : "/"
>> </hansl>
>>
>> gives an error, because the backslash is considered an escaping
>> character. This breaks the xy_color packages (and possibly some more).
>
> The thread in December "problem with sprintf in ternary statement" looks
> related. Allin fixed a bug there by removing a special-casing treatment
> of \" , but this may be a side effect.
OK, I've had a further go at fixing this in git. It seems there
_was_ a rationale for the old special-casing of backslash-quote in the
conditional assignment context, but it should be turned off whenever
the sub-context is sprintf().
Could you elaborate on this? In principle it seems that it only matters
whether we have a string literal or something inside sprintf. (Because
as per the doc the meaning of a backslash changes.)
I don't really understand why the ternary statement context is special
at all - OK I can understand it is more difficult to parse, but the same
complication would arise in some other syntactical constructs, no?
thanks
sven