Interpolating expressions #73
Labels
brainstorming
Less of an issue, more of a place to kick around ideas.
compatibility-breaking
Making this change would break backward compatibility.
Milestone
One potential approach for interpolating expressions in escaped strings:
\
is followed by any name, interpolate that name. (Similar to the current situation, but could be updated to allow non-alphabetical names like$0
and to disallow things that look like names but are not--see Interpolating an operator should give a syntax error #72.)\
is followed by any open bracket ((
,[
,{
), scan the string from that bracket on and parse one expression starting from that bracket. Interpolate that expression and continue processing the string from the point where the expression ends.\"
could be interpolated this way. That means no interpolated strings inside interpolated expressions, no regular strings that end with backslashes, and no'\
followed by a string (just add a space or a semicolon, in that case).{
interpolation eval the block and interpolate the result? That's probably more useful than interpolating the block itself.\
is followed by any unary operator, parse an expression starting from that operator. It wouldn't actually be that much harder, I think.The text was updated successfully, but these errors were encountered: