Skip to content

[BUG] bpp: Nonprimitive assignments prefacing commands should be command-local only #20

Description

@rail5

BUG HOME
Compiler

BUG DESCRIPTION
In Bash, prefacing a command with variable assignments has the effect that those assignments only hold for that command. E.g.:

var="initial value"
var="new value" echo hi
echo $var # This echoes "initial value"
# Since $var only held "new value" for the duration of the command that directly followed the assignment

However, our compiler currently does not take care in this case to ensure that these assignments are in fact command-local

To Reproduce

@object.member="initial value"
@object.member="new value" echo hi
echo @object.member # This echoes "new value" -- it should not.

TODO: Review specific wording in Bash manual pages to ensure that we're matching their behavior exactly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions