Skip to content

Conversation

@c42f
Copy link
Member

@c42f c42f commented Aug 18, 2019

The var"##" syntax should be disabled in string interpolation.

Also work around a subtle problem with command interpolation's use of Meta.parse in non-greedy mode, combined with the new var syntax which would cause Base.shell_parse("\"(\$var)\"") to miss the trailing ) character.

This is a quick fix for a bit of fallout from #32408 which affects PyCall's build script, among other things.

Fixes #32951

@c42f c42f requested a review from JeffBezanson August 18, 2019 01:05
@c42f c42f added bugfix This change fixes an existing bug parser Language parsing and surface syntax labels Aug 18, 2019
The var"##" syntax should be disabled in string interpolation.
@c42f c42f force-pushed the cjf/fix-interpolated-var branch from 1994e77 to 2ca4b31 Compare August 19, 2019 02:41
@c42f
Copy link
Member Author

c42f commented Aug 19, 2019

Right I've sorted those problems out!

I also added a workaround to preserve the behavior of Base.shell_parse (and hence @cmd interpolation) with $var interpolation. This is ugly but the alternative is a non backward compatible change to the way that @cmd handles $ interpolation in general.

I think we should change the way $ interpolation works in cmd, but I don't want to couple that breaking change with getting this bug fixed.

@c42f c42f force-pushed the cjf/fix-interpolated-var branch from 9e01f42 to 941a6a9 Compare August 19, 2019 04:14
This is special cased for compatibility. A more general fix would be to
make cmd interpolation syntax exactly the same as string interpolation.
@c42f c42f force-pushed the cjf/fix-interpolated-var branch from 941a6a9 to 9cc2f44 Compare August 19, 2019 04:22
@c42f
Copy link
Member Author

c42f commented Aug 19, 2019

CI errors look unrelated (win64 — temp files; freebsd — an internal build slave error).

@c42f
Copy link
Member Author

c42f commented Aug 20, 2019

@JeffBezanson can you live with the ugly shell_parse compatibility workaround I've got here? If so I'd like to merge this and come back to the inconsistency between cmd interpolation vs string interpolation another time. (Edit: to be clear, this inconsistency is nothing new.)

@MikeInnes
Copy link
Member

This bug breaks both Juno and the CUDA stack, so it'd be great to get the fix in quickly.

@chriscoey
Copy link

bump

@JeffBezanson JeffBezanson merged commit 050160c into master Aug 22, 2019
@delete-merged-branch delete-merged-branch bot deleted the cjf/fix-interpolated-var branch August 22, 2019 17:15
KristofferC pushed a commit that referenced this pull request Aug 25, 2019
The var"##" syntax should be disabled in string interpolation.

Disallow `var` syntax in command interpolations

This is special cased for compatibility. A more general fix would be to
make cmd interpolation syntax exactly the same as string interpolation.

(cherry picked from commit 050160c)
stevengj added a commit to JuliaPy/PyCall.jl that referenced this pull request Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug parser Language parsing and surface syntax

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weird error with $var and interpolation

7 participants