Repository navigation
fix(interpreter): expand array literals like command words - #2594
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 82e971b | Commit Preview URL Branch Preview URL |
Oct 07 2026, 08:45 PM |
Array literal words now get brace and pathname expansion (nullglob honored, quoted words literal), and [i]=value elements set that index. command -v accepts several names and succeeds when any is found. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
The per-word brace, glob and [i]=v handling grew the simple-command future and overflowed the two-MiB recursion check under coverage. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
chaliy
force-pushed
the
claude/oracle-small-gaps
branch
from
October 7, 2026 20:44
fdfcd76 to
82e971b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
arr=(...)) run brace expansion and pathname expansion on each word, the same as command arguments.nullglobis honored and quoted words stay literal.[i]=valueelements inside an array literal set that index (no splitting or globbing of the value), and later plain words continue fromi+1.command -vaccepts several names, prints each one it finds, and exits 1 only when none was found.Why
Debian-oracle gaps: scripts collecting files with
files=(*.txt)got the literal pattern, andarr=([2]=x)stored the text[2]=x.Before / After
touch a.txt b.txt; arr=(*.txt); echo ${#arr[@]}1(*.txt)2arr=(x{1,2}); echo ${arr[@]}x{1,2}x1 x2shopt -s nullglob; arr=(*.zz); echo ${#arr[@]}10arr=([2]=x y); declare -p arr([0]="[2]=x" [1]="y")([2]="x" [3]="y")command -v nope echo; echo $?1, nothing printedecho,0New spec file
array-literal-expansion.test.sh(7 cases), each verified against bash 5.2.Risk
Low. Under
failgloban unmatched array-literal pattern is stored as-is instead of aborting the assignment (WTF comment in code).declare -a d=(...)still goes through the declare builtin path and is not changed here. Stack checkdepth_50_is_boundedpasses at 2.01 MB.Checklist
cargo test -p bashkit --lib,--test integration, bash_comparisoncargo clippy --all-targets -D warnings,cargo fmt --checkhttps://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code