You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is similar to #743, but applied to arithmetic expressions rather than assignment expressions.
I think it makes sense to do this kind of "second pass parsing", where we do an arithmetic expression parse on the expanded string field while interpreting. We can't pretend to only support parsing statically, because then we lose too much compatibility with sh/bash, as you point out.
I think my only worry would be the performance; we don't want to be re-parsing absolutely every string that goes through the arithmetic expression interpreter. One way would be to only do this re-parsing if a field was a quoted string.
Given
let.sh
as the input file:On bash:
Versus on gosh:
Gosh correctly evaluated
let varone=1 vartwo=++varone
but notlet myvar="16 << 2"
.The text was updated successfully, but these errors were encountered: