Last 12 weeks · 7 commits
2 of 6 standards met
Fixes #148 Reserved words (, , , , etc.) were rejected wherever a bare unquoted word could appear, not just as a command name. That meant failed to parse, even though only has any special meaning as the first word of a command. POSIX (XCU 2.4 "Reserved Words", and grammar rule 7a/7b) only recognizes a word as reserved when it's unquoted and sits in a "reserved word position" — most notably , the first word of a simple command. Argument words () are always plain s, and quoting a reserved word anywhere, including command-name position, suppresses recognition entirely. This shell doesn't implement /// compound commands, so a bare reserved word as a command name is still rejected — but with a clear "Unsupported reserved word" error rather than silently becoming a nonexistent command name that fails at runtime. The fix moves the reserved-word check out of the generic word parser (which was applied to every word, argument or not) into a new , used only for the first word of . Because the check previously lived in the shared word parser, this also loosens two positions beyond argument words that were incidentally caught by it: reserved words are now accepted as env var values ( previously failed with "Invalid environment variable value"; it now parses) and as redirect targets (, ). Neither is a command name, so per POSIX neither should have been reserved-word-checked in the first place. Tested with a new test covering: all reserved words as arguments (single and multiple), reserved words as arguments to arbitrary commands, env var values, word-boundary/substring cases, quoting (full and partial) in both command-name and argument position, rejection at every command-name position in a script (after , , , , in subshells, across newlines), and case-sensitivity. Full existing test suite passes (, , ). This PR was prepared by an AI agent (Kiro) on behalf of @mrgrain. Human reviewed.
Repository: denoland/deno_task_shell. Description: Cross-platform shell for deno task. Stars: 139, Forks: 25. Primary language: Rust. Languages: Rust (100%). License: MIT. Homepage: https://crates.io/crates/deno_task_shell Latest release: 0.33.3 (3w ago). Open PRs: 2, open issues: 17. Last activity: 3w ago. Community health: 37%. Top contributors: dsherret, denobot, bartlomieju, wolfv, magurotuna, devsnek, ruben-arts, UltiRequiem, Hofer-Julian, dahlia and others.