Skip to content
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

Apply nounset option in arithmetic expansion #263

Merged
merged 3 commits into from
May 21, 2023
Merged

Conversation

magicant
Copy link
Owner

No description provided.

@magicant magicant self-assigned this May 18, 2023
For the yash-arith crate to support the "nounset" shell option, we need
to make variable access fallible.
Comment on lines +212 to +214
// TODO If the variable exists but is not scalar, UnsetVariable
// does not seem to be the right error.
Off => Err(UnsetVariable),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To resolve this to-do, we will need to change struct UnsetVariable into an enum:

enum GetVariableError {
    UnsetVariable,
    NonScalarVariable { assignment_location: Location },
}

@magicant magicant marked this pull request as ready for review May 21, 2023 03:16
@magicant magicant merged commit 28afa30 into master May 21, 2023
@magicant magicant deleted the nounset_in_arith branch May 21, 2023 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant