From 1f249afed77fa57b6f40b1f72ad64e20b89f11ce Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Fri, 11 Apr 2025 13:45:31 +0100 Subject: [PATCH] fix: allow `,` in unquoted words --- crates/deno_task_shell/src/grammar.pest | 2 +- crates/tests/src/lib.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/deno_task_shell/src/grammar.pest b/crates/deno_task_shell/src/grammar.pest index f00ecd5..094e058 100644 --- a/crates/deno_task_shell/src/grammar.pest +++ b/crates/deno_task_shell/src/grammar.pest @@ -153,7 +153,7 @@ EXIT_STATUS = ${ "$?" } // Operators OPERATOR = _{ AND_IF | OR_IF | DSEMI | DLESS | DGREAT | LESSAND | GREATAND | LESSGREAT | DLESSDASH | CLOBBER | - "," |"(" | ")" | "{" | "}" | ";" | "&" | "|" | "<" | ">" + "(" | ")" | "{" | "}" | ";" | "&" | "|" | "<" | ">" } // Reserved words diff --git a/crates/tests/src/lib.rs b/crates/tests/src/lib.rs index c472fbb..3123f38 100644 --- a/crates/tests/src/lib.rs +++ b/crates/tests/src/lib.rs @@ -1479,6 +1479,17 @@ async fn test_reserved_substring() { .await; } +#[tokio::test] +async fn test_comma_unquoted() { + // Allow `,` in unquoted words + TestBuilder::new() + .command("echo a,b,c") + .assert_exit_code(0) + .assert_stdout("a,b,c\n") + .run() + .await; +} + #[cfg(test)] fn no_such_file_error_text() -> &'static str { if cfg!(windows) {