-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arith assignment where var name is dynamic doesn't work #640
Comments
Actually I realized there is an asymmetry as @akinomyoga pointed out on #648 . A variable name is another type of arithmetic expression, like As mentioned, there's only one level of evaluation, not recursive evaluation.
So then if we have this:
Then it seems inconsistent to treat it as a variable name. It's possible to do but it's a little trickier than I thought it would be. I have half a patch now. We would need to get rid of the The main reason I wanted to do this is to at least be able to PARSE ble.sh (#653). I think it's the last thing that doesn't parse. |
I'm leaving this aside for now, but there is a partial implementation on branch https://github.com/oilshell/oil/commits/dev/andy-20 Half of it is that I'm unsure about the semantics, and half of it is that it's a bigger change than I thought. For now cases 52-55 in |
On the other hand, one reason I wanted to fix this was because it also addresses another "smell" in the code:
Also, a workaround is
|
Addresses #640 for ble.sh. But this option could be used in other cases where we're thinking about expanding the Oil language.
From #620, ble.sh uses this in several places. All shells support it
The text was updated successfully, but these errors were encountered: