Skip to content

fix(interpreter): compose indirect expansion with default operator#1033

Merged
chaliy merged 2 commits intomainfrom
fix/issue-937-indirect-expansion-default
Apr 3, 2026
Merged

fix(interpreter): compose indirect expansion with default operator#1033
chaliy merged 2 commits intomainfrom
fix/issue-937-indirect-expansion-default

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 3, 2026

Summary

  • Fix ${!var:-default} and other indirect+operator combinations that returned empty
  • Parser now stops var name scanning at operator chars (:, -, =, +, ?)
  • Interpreter composes indirect resolution with apply_parameter_op

Test plan

  • Unit test: test_indirect_expansion_with_default (set, unset, empty, :=)
  • Spec tests: indirect-expansion.test.sh with 4 cases
  • Full test suite passes

Closes #937

chaliy added 2 commits April 3, 2026 09:42
${!var:-default} now correctly resolves the indirect reference first,
then applies the operator to the resolved target variable. Previously
the parser consumed operator characters as part of the variable name.

Closes #937
… 2.7.0

Cargo resolved newer tokio patch versions; add cargo-vet exemptions to
unblock CI audit check.
@chaliy chaliy merged commit 5f72ac0 into main Apr 3, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-937-indirect-expansion-default branch April 3, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indirect variable expansion with default operator ${!var:-} returns empty

1 participant